c# - Linq to Entities Distinct Clause -


i want add distinct code below. cannot figure out exact syntax. in advance.

var testdates = (from o in db.fmcsa_me_test_data                  orderby o.date                     select new                  {                     requestdate = o.date                  }); 

use distinct() extension method.

note distinct() may negate existing orderby (i've noticed in linq sql), may want use orderby() method afterwards.

var testdates = (from o in db.fmcsa_me_test_data                  select new                  {                      requestdate = o.date                  }).distinct().orderby(x => x.requestdate); 

Comments

Popular posts from this blog

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

apache - Add omitted ? to URLs -

php - How can I stop spam on my custom forum/blog? -