I have a table with Guid column as primary key.
How can I get the row index of a column using entity framework. For example I want to get the row index of Grapes
I have a table with Guid column as primary key.
How can I get the row index of a column using entity framework. For example I want to get the row index of Grapes
You can get the index of the element directly if your list has implemented indexer.
In your case, for example if you want the Grapes index you can do this (I do not recommend using it in tables with many elements because from the point of view of the performance ToList() is bad):
Table test= Table.Where<Table>( x => return x.Name== "Grapes";).Single<Table>();
int index = Table.ToList().IndexOf(test);