MergeOption

确定用于将实体发送到数据服务或从数据服务中接收实体的同步选项。 

Queries executed by the Entity Framework are evaluated against the data in the data source and the results will not reflect against the new objects in the object context. If an entity with the same identity as the one being queried for is already attached to the context, the data coming from the data source and the data already in the context are merged according to the MergeOptionof the query. To get the data that is in the cache, use the GetObjectStateEntries method on theObjectStateManager class. The ObjectStateManager manages the state of objects inside an object context, so if you want to get all the objects that were added, modified and unchanged, you can pass a bitwise OR of the following EntityState values to the GetObjectStateEntries method: Added, Modified, Unchanged. For more information see the blog that demonstrates how to perform local queries.

MergeOption_第1张图片 

 

你可能感兴趣的:(option)