I have the following LINQ query –
var data = (from req in db.tblRequirements
where req.guidRequirementId == guidRequirementId
&& (!db.ViewMIPRAlls.Any(x=>x.guidRequirementId == req.guidRequirementId))
select new
{
guidRequirementId = req.guidRequirementId,
strStatus = req.tblCodesRequirementStatus.strDescription,
strNumber = req.ViewNumber.strAwardNumber,
strOffice = req.tblOrganization.strAcronym,
strCustomerOffice = req.tblOrganizationCustomer.strAcronym,
strDescription = req.strDescription,
strNotes = req.strNotes,
strStatusId = req.strStatusId,
strCompany = req.strCompany,
strUpdatedBy = Person.GetPersonNameFromUserID(req.guidUserId),
dtmUpdated = Requirement.UpdateTime(req.guidRequirementId),
dtmEsitmatedEnd = (req.tblDates.Select(x=>x.dtmEnd) != null
? req.tblDates.Select(x=>x.dtmEnd.ToShortDateString()).ToString()
: ""
)
}).OrderBy(x=>x.dtmEnd);
and I am unable to order it by date. This query results in the following error:
Could not format node ‘ClientQuery’ for execution as SQL.
Either Orderby Before the select, or Orderby by something you’ve created in the select