I'm trying to query a view with linq and I need help on this. The view returns the following structure :
ID Col1 Col2 Col3
1 A B 1
1 A B 2
1 A B 3
1 A B 4
etc...
I have an Entity which has a list as a field
class MyEntity {
int _col1;
string _col2;
List<int> _col3 = new List<int>();
}
How can I get fill the list and get all the entities "MyEntity" at the same time?
My attempts is not complet that's why i asked :
List<MyEntity> allObjects = (from d in _dc.myView
where id==1 %% col1==A && cole2==B
select new MyEntity(d.id,d.col1,d.col2)).Distinct().List();
Thank you,