I'm using Entity Framework, and I have a condition that has not worked very well:
.Where(x => ((DateTime.Now - (x.DataInicio.Value == null ? DateTime.Now : x.DataInicio.Value)).TotalMinutes) < x.Item.MinutosMaximo)
Types :
-
x.DataInicio.Value: DateTime?
-
((...).TotalMinutes): Double
-
x.Item.MinutosMaximo: int
The error returned is:
DbArithmeticExpression arguments must have a common numeric type. Unable to cast and convert to repository.