DateTimeOffset vs DateTime
All of the dates in our tables are DateTime (sql version mainly) and all the dates are stored as local time (dumb design mainly). I am slowly modernizing the backend and slowly copying all the domain logic into .NET Standard libs so we can transition the app from .NET Framework to .NET 8+. Since none of the new code is being used by the app yet, I figured now might be a good time to fix our local DateTime dumb design.
1) keep new entities using DateTime properties and table stays u changed
2) new domain models uses DateTimeOffset for those properties
3) mapping layer handles converting DateTime to DateTimeOffset and vice versa when moving data in/out of persistence.
That way when we can transition the tables to be DateTimeOffset we can support that by just updating the entities and patching the mapping layer.
How does this sound?
1) keep new entities using DateTime properties and table stays u changed
2) new domain models uses DateTimeOffset for those properties
3) mapping layer handles converting DateTime to DateTimeOffset and vice versa when moving data in/out of persistence.
That way when we can transition the tables to be DateTimeOffset we can support that by just updating the entities and patching the mapping layer.
How does this sound?
