DeleteObject method is missing in Entity Framework 4.1

后端 未结 2 609
天涯浪人
天涯浪人 2021-01-15 04:33

This is driving me crazy. I am getting error that

object doesn\'t contain definition for DeleteObject.

Here is my line of code

2条回答
  •  半阙折子戏
    2021-01-15 05:09

    The DbContext API defines DbSets not ObjectSets. DbSet has a Remove method not DeleteObject method. You need to first decide which API you are going to use. If it the ObjectContext or DbContext.

提交回复
热议问题