Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Order by 4 columns query in EF with lambda

$
0
0

anyone can post what will be query in EF if i have order by clause for 4 columns.

i got one with lambda

var qry = ctx.DestinationTimings.Where(x => x.DestinationID == this.ID)
                 .OrderBy(t => t.Date ?? DateTime.MaxValue)
                 .ThenBy(t => SqlFunctions.CharIndex(t.DayOfWeek + ",", "MON,TUE,WED,THU,FRI,SAT,SUN"))
                 .ThenBy(t => t.Time);

how to have mutiple order by ASC and DESC because in above query there is no ascending or descending word.

how to do the same without lambda with ASC and DESC keyword.

please post a sample query with lambda.


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>