The following linq to entities query yields the following result:
public class UserCountResult { public DateTime? date { get; set; } // **should this be string instead?** public int users { get; set; } public int visits { get; set; } } public JsonResult getActiveUserCount2(string from = "", string to = "") { var query = from s in db.UserActions group s by EntityFunctions.TruncateTime(s.Date) into g select new UserCountResult { date = g.Key,
Result:
[{"date":"\/Date(1383433200000)\/","users":21,"visits":47},{"date":"\/Date(1383519600000)\/","users":91,"visits":236}]
Instead of something like / Date (1383433200000) /, I need a date in the format "dd.MM.yyyy", for example
[{"date":"29.11.2013","users":21,"visits":47},{"date":"30.11.2013","users":91,"visits":236}]
I have not found a way to change the format in the request, and I'm not sure what to do. I don't even understand why g.Key is null. Thanks for any input!
peter source share