How to manage GetDate() with Entity Framework

前端 未结 5 1238
一生所求
一生所求 2021-02-07 03:52

I have a column like this in 1 of my database tables

DateCreated, datetime, default(GetDate()), not null

I am trying to use the Entity Framewor

5条回答
  •  盖世英雄少女心
    2021-02-07 04:50

    You have to manually edit the edmx xml and set your SSDL StoreGeneratedPattern attributes to identity or computed. But whenever you update your edmx via the designer your changes will get overwritten.

    This is a known issue. Please see the following links for more details:

    Microsoft Connect Ticket

    Using a GUID as an EntityKey in Entity Framework 4

提交回复
热议问题