nerdexam
Microsoft

70-516 · Question #176

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…

The correct answer is B. Modify the .edmx file to include the following line of code. <Association Name="FK_OrderDetails_Orders1"> <End Role="Orders" Type="StoreDB.Store.Orders" Multiplicity="1"> <OnDelete Action="Cascade" /> <End Role="OrderDetails" Type="StoreDB.Store.OrderDetails" Multiplicity="*" /> <ReferentialConstraint> <Principal Role="Orders">…

Implementing Data Access

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. 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?

Options

  • AModify the .edmx file to include the following line of code:
  • BModify the .edmx file to include the following line of code:
  • CUse the Entity Data Model Designer to set up an association between the Contractor class
  • DUse the Entity Data Model Designer to set up a referential constraint between the primary

How the community answered

(62 responses)
  • A
    5% (3)
  • B
    73% (45)
  • C
    10% (6)
  • D
    13% (8)

Explanation

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

Topics

#Entity Framework#table-per-hierarchy#inheritance mapping#condition mapping

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice