PrepAway - Latest Free Exam Questions & Answers

What should you do?

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. The database includes a table that contains information about all the employees.
The database table has a field named EmployeeType that identifies whether an employee is a Contractor or a Permanent employee.
You declare the Employee entity base type. You create a new Association entity named Contractor that inherits the Employee base type.
You need to ensure that all Contractors are bound to the Contractor class. What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Modify the .edmx file to include the following line of code:
<NavigationProperty Name=”Type” FromRole=”EmployeeType” ToRole=”Contractor” />

B.
Modify the .edmx file to include the following line of code:
<Condition ColumnName=”EmployeeType” Value=”Contractor” />

C.
Use the Entity Data Model Designer to set up an association between the Contractor class and EmployeeType.

D.
Use the Entity Data Model Designer to set up a referential constraint between the primary key of the Contractor class and EmployeeType.

Explanation:
<Association Name=”FK_OrderDetails_Orders1″>
<End Role=”Orders” Type=”StoreDB.Store.Orders” Multiplicity=”1″>
<OnDelete Action=”Cascade” />
</End>
<End Role=”OrderDetails” Type=”StoreDB.Store.OrderDetails” Multiplicity=”*” />
<ReferentialConstraint>
<Principal Role=”Orders”>
<PropertyRef Name=”ID” />
</Principal>
<Dependent Role=”OrderDetails”>
<PropertyRef Name=”OrderId” />
</Dependent>
</ReferentialConstraint>
</Association>

One Comment on “What should you do?


Leave a Reply