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 ...