Is there an easy way to make EntityFramework use SQL default values?

前端 未结 3 1751
轻奢々
轻奢々 2020-12-03 17:23

For example, most of my entities have DateCreated and DateModified fields. The defaults to these are set to GetUtcDate() in SQL Server.

If I try and create an entity

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-03 18:11

    Have you tryed to set the DefaultValue of the Property in the Entity?

提交回复
热议问题