I hope this can be resolved by LINQ without any additional operations.
For input I have a list of models:
public class Model
{
public int A { get; set; }
public string B { get; set; }
public int C { get; set; }
}
On the result I should have
Dictionary<int, Dictionary<string, List<Model>>>();
I have tried next example:
var r = (from t in list
group t by new {t.A, t.B}
into grp
select new
{
grp.Key.A,
grp.Key.B,
Q = grp
}).ToList();
But it gives me not that I expected, is there any way how to solve this ?