How can NodaTime be used with EF Code First?

Until custom primitive type persistence is natively supported in Entity Framework, a common work around is to use buddy properties. For each custom primitive within your domain model, you create an associated mapped primitive to hold the value in a format supported by Entity Framework. The custom primitive properties are then calculated from the value … Read more

Instant.Now for NodaTime

I did a bit of research and it seems that the NodaTime way is to get the now moment according to a clock. If you want to get the current time using the system clock, just use SystemClock.Instance.GetCurrentInstant(). However, instead of using the SystemClock.Instance directly in your code, it’s preferable that you inject an IClock … Read more

tech