0

I've a list of tasks. Ie I've struct like

struct Task
{
    public DateTime Completed { get; set; }
    public string TaskKind { get; set; }
    public float Effort { get; set; }
}

And I've a IList<Task>.

Now I want to group the tasks based on the date and group by TaskKind on each day with the summed effort. For eg for I want to print like the below:

01-09-09     Design:10     Coding:5    Coordination:15
02-09-09     Coding:5       Meeting:2

Can anyone help me in constructing a LINQ query to achieve this?

4

1 に答える 1

0

これは、単純な集計 (TaskKind による COUNT) と PIVOT の組み合わせです。この質問を見てください: LINQ を使用してデータをピボットすることは可能ですか?

于 2009-11-22T14:22:39.533 に答える