ObjectContext.Refresh()?

后端 未结 4 2001
天涯浪人
天涯浪人 2020-11-30 06:15

How to update ALL the dirty entities from the data store, and reset their changed values to the original store value?

The method ObjectContext.Refresh requires as a

4条回答
  •  春和景丽
    2020-11-30 06:49

    The following usually works:

    Context.Refresh(RefreshMode.StoreWins, _
        Context.ObjectStateManager.GetObjectStateEntries())
    

    It sometimes causes problems with EntityRelations. look at my comment for further details.

提交回复
热议问题