Linq Query join with multiple table with order by clause

anil kumar 61 Reputation points
2021-10-20T08:57:21.487+00:00

var filterresult = (from e in employees
select new EmpAttendanceViewModel
{
AId = e.AId,
EmpId = e.Empid,
Name = e.name,
offid = (from att in empAttendances where att.EmpAId == e.AId select e.OffMasId).FirstOrDefault(),
Time = (from att in empAttendances where att.EmpAId == e.AId select (att.TOut - att.TIn).ToString()).FirstOrDefault(),//(t1.TOut - t1.TIn).ToString() //
}).ToList().OrderBy(e=>e.offname).ThenBy(d=>d.dat);;

Do you mean you want to order the result with offname and attdate? If that is the case, can you tell us which table the offname and attdate belong to?

Besides, since this is a new question, and the original question is old and have been solved, I suggest you could close the current thread and post a new thread about your new problem. Then we can find the new problem more easily, and help you solve it.

Above is my last thread and in above employee has offid an attendance table has adate by which i want to apply order by clause

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,140 questions
{count} votes