I have 2 DateTime values that have seconds I compare them with 2 other DateTimes these dont have seconds thats why I never get the result I want. Is it possible to remove the seconds from the DateTimes inside the Lambda expression
ListData = _UnitOfWork.Data.Query(x =>
x.DateTimeWithSeconds1 >= DateTimeWithoutSeconds1 && x.DateTimeWithSeconds2 <= DateTimeWithoutSeconds2).ToList();
Thats my Code right now that doesn't work
ListData = _UnitOfWork.Data.Query(x =>
x.DateTimeWithSeconds1.AddSeconds(-x.DateTimeWithSeconds1.Seconds) >= DateTimeWithoutSeconds1 && x.DateTimeWithSeconds2.AddSeconds(-x.DateTimeWithSeconds2.Seconds) <= DateTimeWithoutSeconds2).ToList();
And that is something i tried but i get an exception that says "LINQ to Entities does not recognize the method 'System.DateTime AddSeconds(Double)'"
Thanks in advance