jacqueskang / EventSourcing

.NET Core event sourcing framework
MIT License
178 stars 29 forks source link

Great library! Should the DateTimes be changed to DateTimeOffset? #76

Open BenjaminCharlton opened 3 years ago

BenjaminCharlton commented 3 years ago

Wow! Thank you so much for developing this and making it publicly available. I only started researching event sourcing and CQRS this week, having looked at DDD more generally a few months back. Your library has been really educational in helping me understand the concepts and is starting to become useful now that I'm working through examples of my own.

One small point (maybe you think it's pedantic). Seeing as timestamps are so important to the auditability of the system, which could be deployed across servers (and accessed by clients) in different time-zones, shouldn't your DateTime objects be DateTimeOffset instead.

If I understand correctly, this is the standard recommended for most use cases by Microsoft:

The uses for DateTimeOffset values are much more common than those for DateTime values. As a result, consider DateTimeOffset as the default date and time type for application development.

https://docs.microsoft.com/en-us/dotnet/standard/datetime/choosing-between-datetime

Maybe I'm totally wrong, in which case, sorry. But if I'm right, it should be an easy fix, right?