return await result.Select(student => new MarkSheetsStudentByIdDto
{
Id = student.RegId,
FullName = student.FullName,
AnnualMarkSheets = student.TermOne
.Select(x => new MarkSheetDto
{
...
Comments = student.Comments.Where(x => x.StudentId.Equals(student.RegId)).Select(x => x.CommentText).ToList()
}).Union(student.TermTwo
.Select(x => new MarkSheetDto
{
...
Comments = student.Comments.Where(x => x.StudentId.Equals(student.RegId)).Select(x => x.CommentText).ToList()
})).ToList()
}).FirstOrDefaultAsync(cancellationToken);
For the above example code snippet, I am getting this error at runtime.
Unable to translate set operation after client projection has been applied. consider moving the set operation before the last 'select' call.
If I remove the comments it will not happen. Can anyone please guide me on how to solve this?