Open ajcvickers opened 4 years ago
I would also just add to emphasize, though it's probably unhelpful, that mapping TimeSpan to Time is the direct conceptual analogy of mapping Length to Position. In fact, Position modulo 24. I.e. the mapping is just flat out wrong, so a breaking change might be warranted.
By default, EF Core maps .NET
TimeSpan
to SQL Servertime
. This is a problematic mapping becausetime
is much more constrained thanTimeSpan
. We have discussed this many times; for example, see https://github.com/dotnet/efcore/issues/242#issuecomment-306174481.With value conversions, it might be better to map
TimeSpan
by default to something else, as suggested in #22633. However, this is both a breaking change and may still be problematic until #10434 is robustly implemented.However, we could generate a warning when this mapping is used.