I have the following SQL and result:
SELECT EventTime FROM Incidents
-- RESULT --
2015-10-20 00:00:00.000
2015-10-20 05:00:00.000
2015-10-20 05:50:00.000
2015-10-20 07:00:00.000
2015-10-20 09:00:30.000
2015-10-21 05:00:00.000
2015-10-21 06:10:00.000
2015-10-22 09:10:00.000
I use the following SQL to filter by plain date (SQL 2014):
SELECT DISTINCT CONVERT (Date, [EventTime]) AS EventDate FROM Incidents
-- RESULT --
EventDate
2015-10-20
2015-10-21
2015-10-22
So very easy in SQL. For LINQ I try the logic:
var q = db.TimeLines.Select(x => x.Time.Date).Distinct();
// show it
q.ToList().ForEach(x => { Console.WriteLine("EventDate: {0}", x); });
Breaks with: Additional information: The specified type member 'Date' is not supported in LINQ...
...How to write the second SQL in LINQ?