Open SteelsenS opened 8 years ago
This fell off my radar but I noticed it in my queue. @brockallen - any preference on which path to take? I'm happy to submit a PR but since there are side effects to every option would like your feedback first.
I think I prefer (4).
Migrated from IdentityServer/IdentityServer3.MembershipReboot#37
A sample demonstrating the issue is available here
When a user account is retrieved from an EF based repository the "Kind" property of the account is not set (Kind = "Unspecified") which can lead to unexpected behavior downstream - an offset may be applied to a time already in UTC. "Kind" is set properly as soon as the record is saved or modified.
The root cause is that EF doesn't allow you to specify a default Kind for DateTime. This has been discussed multiple times on SO, e.g., here, here, here.
Copying from the previous issue report:
Options to remedy are essentially:
Kind
propertyAll of these could have side effects depending on how people are using DateTime values. (1) is a breaking change, (2) and (3) could affect people overriding the base Created/Updated/etc. properties, (4) could cause unexpected behavior for people who have extended
RelationalUserAccount
with custom DateTime properties that are for some reason not persisted in UTC.Ideal resolution will probably be either (3) or (4) depending on feedback here.