I've been struggling with this for hours and am sure there is a simple explanation.
I have a SQL Server table that contains the columns DayOfWeek (DateTime), StartTime (Time), EndTime (Time).
I am trying to write a lambda select that gets all the rows where DateTime.Now is the same DayOfWeek, greater than StartTime and less than EndTime.
I think I have to use the SQL Server type Time as C# Timespan but I'm just not getting it right.
I've tried to work from the explanation here (Datetime.now as TimeSpan value?) but to no avail.
My line of code is:
context.DayAndTimeModifiers
       .Where(x => x.IsActive && (int)d.DayOfWeek == x.DayOfWeek 
                   && d.??? > x.StartTime 
                   && d.??? < x.EndTime)
Any help much appreciated.