Is it possible to globally set Entity Framework DbContext
to use datetime2
for all properties that are System.DateTime
when using Code-First model?
I can do this for each column by using HasColumnType()
method, but for an existing codebase I would like a global solution.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…