nerdexam
Microsoft

70-516 · Question #131

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use the ADO.NET Entity Framework to model your entities. You use Plain Old CLR Objects (POCO)…

The correct answer is C. DetectChanges. When working with POCO, you must call the DetectChanges method on the ObjectContext to attach the POCO entity to the ObjectContext. Be sure to call DetectChanges prior to calling ApplyPropertyChanges Obsolete. Applies property changes from a detached object to an object already…

Manipulating and Validating Data

Question

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. You use the ADO.NET Entity Framework to model your entities. You use Plain Old CLR Objects (POCO) entities along with snapshot-based change tracking. The code accesses the POCO entities directly. You need to ensure that the state manager synchronizes when changes are made to the object graph. Which ObjectContext method should you call?

Options

  • ARefresh
  • BSaveChanges
  • CDetectChanges
  • DApplyPropertyChanges

How the community answered

(16 responses)
  • B
    6% (1)
  • C
    81% (13)
  • D
    13% (2)

Explanation

When working with POCO, you must call the DetectChanges method on the ObjectContext to attach the POCO entity to the ObjectContext. Be sure to call DetectChanges prior to calling ApplyPropertyChanges Obsolete. Applies property changes from a detached object to an object already attached to the object context. CHAPTER 6 ADO.NET Entity Framework Lesson 2: Querying and Updating with the Entity Framework Attaching Entities to an ObjectContext (page 438)

Topics

#POCO#snapshot change tracking#DetectChanges#ObjectContext

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice