I would like the method to return a dictionary dictionary from an IQueryable formula. Usually,
Dictionary<int, Dictionary<DateTime, string>>
At first I looked at ToDictionary (), but could not find a way to declare two after another.
Then I looked at ToLookup (), and I have a way to wrap this with ILookup, where the line is my secondary dictionary (DateTime.Tostring () + another line) ... you follow? :) But I didn’t find the ILookup solution really confortable (parsing a date on a string and when I get a data string → for today .. beuark)
It will give something like this
return this.ttdc.Trackers.GroupBy(t => new { TrackerTaskId = t.TrackerTaskID, DateGenerated = t.TrackerDateGenerated })
.Select(t => new { taskId = t.Key.TrackerTaskId, DateGenerated = t.Key.DateGenerated, count = t.Count() })
.ToLookup(k => k.taskId.Value, k => k.DateGenerated.Value.ToString() + "|" + k.count);
Now I'm thinking of creating a list of a self-created class with 3 information that I need as properties.
Could you help me choose the best sample? This method is hosted on a Windows service, and I would like to limit the amount of data transferred to the client.