In my application, with Entity Framework, I make a query in an Entity Framework:
var lista = contexto.Rodada.Where(condições);
Then iterate over this list with a foreach.
During the iteration there are "updates" and "inserts" of several entities and one of them is responsible for the following error:
The conversion of a datetime2 data type to a datetime result in an out-of-range value. The statement has been terminated.
Searching, I saw that the reason for this error is that the default value (or minimum) for the datetime in C # is outside the accepted range of values in Sql Server:
I am trying to find where this occurs, but there are many datetimes across multiple entities, and the stack trace did not help me at all. Is there any way to identify the entity that has thrown the error?