nerdexam
Microsoft

70-516 · Question #48

You use Microsoft Visual Studio 2010 and .NET Framework 4.0 to develop an application that uses the Entity Framewok. You need to execute custom logic when an entity is attached to the ObjectContext…

Sign in or unlock 70-516 to reveal the answer and full explanation for question #48. The question stem and answer options stay visible for context.

Implementing Data Access

Question

You use Microsoft Visual Studio 2010 and .NET Framework 4.0 to develop an application that uses the Entity Framewok. You need to execute custom logic when an entity is attached to the ObjectContext. What should you do?

Options

  • ACreate a partial method named OnStateChanged in the partial class for the entity.
  • BCreate a partial method named OnAttached in the partial class for the entity.
  • CCreate an event handler to handle the ObjectStateManagerChanged event.
  • DCreate an event handler to handle the ObjectMaterialized event.

Unlock 70-516 to see the answer

You've previewed enough free 70-516 questions. Unlock 70-516 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#Entity Framework#ObjectContext#ObjectStateManagerChanged#entity lifecycle
Full 70-516 Practice