Why does the ObjectStateManager property not exist in my db context?

后端 未结 2 791
轻奢々
轻奢々 2020-12-29 17:36

I need to return a list of newly added objects from my database context.

I have read that i have to use ObjectStateManager for this purpos. The problem

相关标签:
2条回答
  • 2020-12-29 18:26

    Try this:

    dbContext.Entry(entity).State = EntityState.Modified;
    
    0 讨论(0)
  • 2020-12-29 18:36

    Try this:

    var manager = ((IObjectContextAdapter)dbContext).ObjectContext.ObjectStateManager;
    
    0 讨论(0)
提交回复
热议问题