I'm struggling to get this to work. I want the EF instruction to be accepted in the order column. My initial expression was as follows:
var Query = from P in DbContext.People
where P.BusinessUnits.Any(BU =>BU.BusinessUnitID == businessUnitId)
orderby P.LastName
select P;
And I changed this to the following:
var Query = from P in DbContext.People
where P.BusinessUnits.Any(BU =>BU.BusinessUnitID == businessUnitId)
orderby sortField
select P;
Where sortFieldis the column that we want to sort, and is the row, that is LastName. However, it does not work, it does not sort, and the output SQL string is completely incorrect. Has anyone got this job before?
source
share