70-516 · Question #127
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server 2008 database. You use the ADO.NET Entity Framework…
The correct answer is D. ApplyChanges. ApplyChanges takes the changes in a connected set of entities and applies them to an Starting with Microsoft Visual Studio 2010, the ADO.NET Self-Tracking Entity Generator template generates self-tracking entities. This template item generates two .tt (text template) files…
Question
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server 2008 database. You use the ADO.NET Entity Framework to model your entities. You use ADO.NET self-tracking entities. You need to ensure that the change-tracking information for the self-tracking entities can be used to update the database. Which ObjectContext method should you call after changes are made to the entities?
Options
- AAttach
- BRefresh
- CSaveChanges
- DApplyChanges
How the community answered
(46 responses)- A11% (5)
- B2% (1)
- C4% (2)
- D83% (38)
Explanation
ApplyChanges takes the changes in a connected set of entities and applies them to an Starting with Microsoft Visual Studio 2010, the ADO.NET Self-Tracking Entity Generator template generates self-tracking entities. This template item generates two .tt (text template) files: <model name>.tt and <model name>.Context.tt. The <model name>.tt file generates the entity types and a helper class that contains the change- tracking logic that is used by self-tracking entities and the extension methods that allow setting state on self-tracking entities. The <model name>.Context.tt file generates a typed ObjectContext and an extension class that contains ApplyChanges methods for the ObjectContext and ObjectSet classes. These methods examine the change-tracking information that is contained in the graph of self- tracking entities to infer the set of operations that must be performed to save the changes in the database. Working with Self-Tracking Entities
Topics
Community Discussion
No community discussion yet for this question.