I am having trouble finding the correct syntax to do the following:
Is it possible with the LINQ (Lambda Expression) expression in .GroupBy and instead of using regular .Sum () or .Count () I want the resulting data to be List of Int.
I defined my own class with the name: Filter_IDs. Its constructor needs two parameters:
public int? type;
I want to load data from my database into this object. The following LINQ query should list Filter_IDs:
The following LINQ query should list Filter_IDs:
List<Filter_IDs> filterids = ef.filterLine .GroupBy(fl => fl.objectType) .Select(fl => new Filter_IDs { type = fl.Key, objects = fl.Select(x => x.object_id).ToList() }) .ToList();
Using this query does not give a build error, but gives a "NotSupportedException" in RunTime.
The database looks to better understand the data:
http://d.pr/i/mnhq+ (droplr image)
Thanks in advance, Gerben
G versluis
source share