The following details the error I am getting The Student Class
public class Student () {
public int Id {get;set;}
public Student(int id IEnumerable<StudentOwner> owner) {
_owners = owners != null ? owners.ToList() : new List<StudentOwner>();
}
private List<StudentOwner> _owners;
}
The StudentDetailsClass
public class StudentDetails () {
pubiic int Id {get; set;}
public DateTime UpdateDate { get; }
public string Comments { get; set; }
public int StudentRef {get; set; }
}
A selection of the offending code for the query is as follows, it works if you order by s.ID
baseQuery = baseQuery.Where(
o => s.StudentDetails
.OrderByDescending(s => **s.UpdateDate**).First().StudentRef
== StudentSearchParams.StudentRef;
The following error occurs, yet if you do order by Id it works but that does not produce the required result. Any ideas ???
.OrderByDescending(s1 => s1.UpdateDate)' could not be translated.
Additional information: Translation of member 'UpdateDate' on entity type 'StudentDetails' failed.
This commonly occurs when the specified member is unmapped. Either rewrite the query in a form
that can be translated, or switch to client evaluation explicitly by inserting a call to
'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.