hi,
my project was created using c# & entity framwork 6
i have this table (entries) that have
status filed
the status filed will fill with one of this values :
Pending,Accepted,Rejected,Delayed,Completed
i want to retrieve all the record sorted with this conditions:-
Accepted rows first then Pending rows, then Delayed, and the completed and reject the last.
What I have tried:
var Query = DB1.entries.Where(u=> u.date >= From && u.date <= To && statusList.Contains( u.Status)).Select(s => new entires
{
ID = s.id,
Name = s.Name,
date = s.date,
Order = s.order,
Topic = s.Topic,
ExternalVisitor = s.ExternalVisitor == 1 ? true : false,
Reason = s.Reason,
waiting = s.waiting,
Status = s.Status,
}).OrderBy(o => o.Status == "pending").ThenByDescending(o => o.date).ToList();