Entity Framework Caching Issue

后端 未结 12 2218
無奈伤痛
無奈伤痛 2020-12-08 00:19

I am new to Entity Framework.

I have get to some values in my database using EF. It returns perfectly, and the values are shown in labels. But When I delete all valu

12条回答
  •  孤街浪徒
    2020-12-08 00:53

    I think what you need is GetDatabaseValues(). It is used like:

    context.Entry(/*your entry*/).GetDatabaseValues();
    

    Information below is from msdn:

    The current values are the values that the properties of the entity currently contain. The original values are the values that were read from the database when the entity was queried. The database values are the values as they are currently stored in the database. Getting the database values is useful when the values in the database may have changed since the entity was queried such as when a concurrent edit to the database has been made by another user.

提交回复
热议问题