Subtract DateTimes in IQueryable query
Hello I'm trying to subtract two DateTimes in my query and compare
defference with timeInterval,but I get exeption:
<Message>An error has occurred.</Message>
<ExceptionMessage>System.TimeSpan
Subtract(System.DateTime)</ExceptionMessage>
<ExceptionType>System.NotSupportedException</ExceptionType>
C# code:
producerRelations = producerRelationRepository.Query().Fetch(c => c.Order).
Where(c => c.Order.CreatedBy == login).
Where(c=>currentDate.Subtract(c.RouteUnit.DtStart.Value).TotalMinutes<timeInterval);
How I can subtract dates in my code?
No comments:
Post a Comment