I have a query where I query between 2 date ranges.
On these dates, I apply DbFunctions.TruncateTime
to filter searches for dates only, ignoring the time.
Note: these are DateTime fields
.Where(p => DbFunctions.TruncateTime(p.DataCadastro) >= DbFunctions.TruncateTime(dataInicial) &&
DbFunctions.TruncateTime(p.DataCadastro) <= DbFunctions.TruncateTime(dataFinal));
However, when using DbFunctions.TruncateTime
the request always returns me:
Expired Execution Timeout. Timeout ended before the operation is completed or the server is not responding.