Microsoft Exam Questions

What should you do?

You use Microsoft Visual Studio 2010 and the Microsoft .NET Framework 4.0 to create an application.
The application connects to a Microsoft SQL Server database. The application uses DataContexts to query the database.
You define a foreign key between the Customers and Orders tables in the database.
You need to ensure that when you delete a customer record, the corresponding order records are deleted.
You want to achieve this goal by using the minimum amount of development effort. What should you do?

A.
Override the Delete operation of the customer entity.

B.
Remove the foreign key between the Customers and Orders tables.

C.
Use the ExecuteDynamicDelete method of the DataContext object.

D.
Modify the foreign key between the Customers and Orders tables to enable the ON DELETE CASCADE option.

Explanation:
DataContext.ExecuteDynamicDelete Method
(http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.executedynamicdelete.aspx)