I am new to WCF. I want to get Json formatted data using LINQ Query with Entity Framework. I am not able to return the value.
This is my code in Interface:
[OperationContract]
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "getcontact")]
List<Tbl_Users> JSONDataAll();
This is my class code:
public List<Tbl_Users> JSONDataAll()
{
var users = (from u in db.Tbl_Users select u);
return users.ToList<Tbl_Users>();
}