I am consuming odata service using DataServiceContext and want to return data in json format.
I am looking something like this: Odata Query with DataServiceContext
You can call context.Format.UseJson method without providing a parameter if you load your service model inside OnContextCreated partial method as shown in the code below:
public partial class DemoService
{
partial void OnContextCreated()
{
this.Format.LoadServiceModel = GeneratedEdmModel.GetInstance;
}
}