Posted on: 7/8/2015 5:45:40 AM | Views : 746

Roles and Privileges have relationship 1 to many. but while serializing the roles i am getting null value "[]" for the privileges. I am using Json to send data to wcf services using EF6 having code first approach.
code : System.Web.Script.Serialization.JavaScriptSerializer objJSSerializer1 = new System.Web.Script.Serialization.JavaScriptSerializer();                 string strJSON1 = objJSSerializer1.Serialize((from role in context.Roles select role).ToList());
output: [{"privileges":[],"users":[],"ID":1,"RoleName":"Admin","IsActive":1},
{"privileges":[],"users":[],"ID":2,"RoleName":"Apprisal Minister","IsActive":0}]

I tried :-  context.Configuration.ProxyCreationEnabled = false; but still not able to get the privileges
W ...

Go to the complete details ...