I know this can be accomplished using the Fluent API on a single property, but I want to have this automatically happen for everywhere I use a .NET DateTime in my model. Here's an example of doing a single property:
modelBuilder.Entity<T>()
.Property(f => f.MyDateTimeProperty)
.HasColumnType("datetime2");
But instead of only on this one property I want it to happen everywhere automatically. There is a fix for this in Model First by editing the T4 generation template so I know it can be done there but I need the same thing in Code First.