The property TimeOfDay does not supported in LINQ to Entities so you can try using SqlFunctions.DatePart method instead.
You should probably also convert your TimeSpans into DateTimes .
I think this should work (assuming the TimeSpans is from the begining of the day):
var now = DateTime.Now;
var today = new DateTime(now.Year, now.Month, now.Day);
var endDateTime = today + endTime;
var startDateTime = today + startTime
var timeCapturesQuery = Context.TimeCaptures.Where(t =>
SqlFunctions.DatePart("timeofday", t.StartDateTime) < SqlFunctions.DatePart("timeofday", endDateTime)
&& SqlFunctions.DatePart("timeofday", t.EndDateTime) > SqlFunctions.DatePart("timeofday", startDateTime));
Edit
As mentioned in the comments the specific property TimeOfTheDay is not supported in DatePart method.
Maybe EntityFunctions.DiffNanoseconds method will work:
var now = DateTime.Now;
var today = new DateTime(now.Year, now.Month, now.Day);
var endDateTime = today + endTime;
var startDateTime = today + startTime
var timeCapturesQuery = Context.TimeCaptures.Where(t =>
EntityFunctions.DiffNanoseconds(t.StartDateTime, endDateTime).Value < 0
&& EntityFunctions.DiffNanoseconds(t.EndDateTime, startDateTime).Value > 0);
Edit2
Another option which is much simpler and I think will work is just to compare the DateTimes.
We've already converted the TimeSpans into DateTimes and we can create a simple condition using LINQ to Entities and it should work because we are not using any of the DateTimes properties.
var now = DateTime.Now;
var today = new DateTime(now.Year, now.Month, now.Day);
var endDateTime = today + endTime;
var startDateTime = today + startTime
var timeCapturesQuery = Context.TimeCaptures.Where(t => t.StartDateTime < endDateTime && t.EndDateTime > startDateTime);