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
Post a Comment