Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Edited Issue: Properties configuration .HasPrecision(byte) doesn't affect DateTime properties [1202]

$
0
0
Configuring precision after changing the column type is a NOOP:
modelBuilder
.Entity<Order>()
.Property(e => e.Date)
.HasColumnType("datetime2")
.HasPrecision(6)

***Original repro:
The convention below should set the default precision for all datetime objects in the model to 6 but currently it is a NOP. The other overload is .HasPrecision(byte, byte) and using this instead has the same behavior.

Convention:
modelBuilder.Properties<DateTime>()
.Configure(c => c
.HasPrecision(6));

Viewing all articles
Browse latest Browse all 10318

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>