70-516 · Question #168
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the Entity Framework Designer to create the following Entity Data Model. The application…
The correct answer is D. Use the ADO.NET EntityObject Generator template to configure all entities to inherit from. You can use the Text Template Transformation Toolkit (T4) to generate your entity classes, and NET provides the T4 EntityObject Generator template by which you can control the entity object Visual Studio .NET also provides the T4 SelfTracking Entity Generator template by which…
Question
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application. You use the Entity Framework Designer to create the following Entity Data Model. The application contains a class as shown in the following code segment. (Line numbers are included for reference only.) 01 public class MyBaseClass : EntityObject 02 { 03 …. 04 } You need to ensure that all generated entities inherit from MyBaseClass. What should you do?
Options
- AChange MyBaseClass to inherit from ObjectContext.
- BCreate a new ObjectQuery that uses MyBaseClass as the type parameter.
- CModify the generated code file so that all entities inherit from MyBaseClass.
- DUse the ADO.NET EntityObject Generator template to configure all entities to inherit from
How the community answered
(60 responses)- A8% (5)
- B5% (3)
- C3% (2)
- D83% (50)
Explanation
You can use the Text Template Transformation Toolkit (T4) to generate your entity classes, and NET provides the T4 EntityObject Generator template by which you can control the entity object Visual Studio .NET also provides the T4 SelfTracking Entity Generator template by which you can create and control the Add an EntityObject Generator to your project and add the new modification to the text template.self-tracking entity classes. Add an EntityObject Generator to your project and add the new modification to the text template. CHAPTER 6 ADO.NET Entity Framework Lesson 1: What Is the ADO.NET Entity Framework? The EntityObject Generator (page 403-404)
Topics
Community Discussion
No community discussion yet for this question.