Table of Contents

Class UtcDateTimeConverter

Namespace
NuvTools.Data.EntityFrameworkCore.Conventions
Assembly
NuvTools.Data.EntityFrameworkCore.dll

Treats every DateTime column as UTC: a Local value is converted before it is written, an unspecified one is taken as UTC, and what is read back is marked Utc.

public class UtcDateTimeConverter : ValueConverter<DateTime, DateTime>
Inheritance
UtcDateTimeConverter
Inherited Members

Remarks

Meant for DateTime columns an application does not own (a library's entities). Its own instants are better modelled as DateTimeOffset, and calendar dates as DateOnly.

Constructors

UtcDateTimeConverter()

Treats every DateTime column as UTC: a Local value is converted before it is written, an unspecified one is taken as UTC, and what is read back is marked Utc.

public UtcDateTimeConverter()

Remarks

Meant for DateTime columns an application does not own (a library's entities). Its own instants are better modelled as DateTimeOffset, and calendar dates as DateOnly.