i have this list in C#:
and i wanna divide it to 4 list like this :
how can i do this with Linq?
You want to group by Field1, so use Enumerable.GroupBy
:
var field1GroupLists = mainList
.GroupBy(x => x.Field1)
.Select(group => group.ToList())
.ToList();