2
I’m having trouble making an ordination in a query where I have to sort the children by the ID, Follow the Source.
public Grid GetByOrderGridData(long id)
{
var query = from c in context.Set<Grid>()
where c.Id == id
orderby c.GridDatas.OrderBy(p => p.Id)
select c;
return query.FirstOrDefault();
}
source compiles without problem but when consulting.
{"Dbsortclause Expressions must have a type that is order comparable. r nName of parameter: key"}
the ordering has to be by the son of Griddatas, in his solution she is returning the ordering by the father the grid in the case and the alias 'C' in the query.
– Thiago Ubiratan