Hi
I have below linq query & i want to get only Last Record out of List
SessionDeliveryCalendar Result = (from t in context.SessionDeliveryCalendars where t.IsActive == true && t.GroupID == GroupID && t.ModuleID == ModuleID && t.Deleted == false && t.CurrentStatus == "Completed" orderby t.SessionDate,t.SessionStartTime descending select t).FirstOrDefault(); return Result;
I am trying like below but it is giving error The query operator lastordefualt is not supported
SessionDeliveryCalendar Result = (from t in context.SessionDeliveryCalendars where t.IsActive == true && t.GroupID == GroupID && t.ModuleID == ModuleID && t.Deleted == false && t.CurrentStatus == "Completed" orderby t.SessionDate,t.SessionStartTime select t).LastOrDefault(); return Result;
Thanks