70-516 · Question #17
70-516 Question #17: Real Exam Question with Answer & Explanation
The correct answer is A. Re-attach the SalesOrderDetail entities. E. Call ObjectContext.ApplyOriginalValue.. ApplyCurrentValues(Of TEntity) Copies the scalar values from the supplied object into the object in the ObjectContext that has the same key. The ApplyCurrentValues<TEntity> method is used to apply changes that were made to objects outside the ObjectContext, such as detached objec
Question
Options
- ARe-attach the SalesOrderDetail entities.
- BSet the MergeOption of SalesOrderDetail to MergeOptions.OverwriteChanges.
- CSet the MergeOption of SalesOrderDetail to MergeOptions.NoTracking.
- DCall ObjectContext.ApplyCurrentValue.
- ECall ObjectContext.ApplyOriginalValue.
Explanation
ApplyCurrentValues(Of TEntity) Copies the scalar values from the supplied object into the object in the ObjectContext that has the same key. The ApplyCurrentValues<TEntity> method is used to apply changes that were made to objects outside the ObjectContext, such as detached objects that are received by a Web service. The method copies the scalar values from the supplied object into the object in the ObjectContext that has the same key. You can use the EntityKey of the detached object to retrieve an instance of this object from the data source. Any values that differ from the original values of the object are marked as modified. Note, the method does not apply the current values to the related objects of currentEntity. ApplyOriginalValues(Of TEntity) Copies the scalar values from the supplied object into set of original values for the object in the ObjectContext that has the same key. The ApplyOriginalValues<TEntity> method is used to apply changes that were made to objects outside the ObjectContext, such as detached objects that are received by a Web service. The method copies the scalar values from the supplied object into the object in the ObjectContext that has the same key. You can use the EntityKey of the detached object to retrieve an instance of this object from the data source. Any values that differ from the current values of the object are marked as modified. Note, the method does not apply the current values to the related objects of originalEntity.
Community Discussion
No community discussion yet for this question.