I am new to JSON and i am trying to get data from database in Sql Server with Asp.net Web Api.
My Output json Array is Like this:
[ { "f0": 9608, "f1": 1461, "frbDescField_F56": "Jan", "f2": "1461", "f3": "179:48"}]
But the output of the Json should be similar to the following code:
{ "restaurants": [ { "f0": 9608, "f1": 1461, "frbDescField_F56": "Jan", "f2": "1461", "f3": "179:48"}] }
and My Code is:
public IEnumerable<VI_TimeTotalMontly> Get(int id, string id1)
{
using (tfmisEntities Entities = new tfmisEntities())
{
var result = Entities.VI_TimeTotalMontly.Where(e => e.F0 == id && e.F2 == id1).ToList();
return result;
}
}
How do I change my codes?