How can I implement DBSet.AddOrUpdate in Entity Framework 4.4?

前端 未结 2 1710
情话喂你
情话喂你 2021-02-19 08:26

In response to Slauma\'s answer to my question about running applications that use EF on Windows XP I am converting my application back from Entity Framework 5.0 to use Entit

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-19 08:53

    You must add...

    using System.Data.Entity.Migrations;
    

    ...to your code file to have AddOrUpdate available. It is an extension method of IDbSet that is implemented in the IDbSetExtensions class in System.Data.Entity.Migrations namespace.

提交回复
热议问题