70-516 · Question #14
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 application uses DataContexts to…
The correct answer is A. Override the Delete operation of the DataContext object. See the full explanation below for the reasoning.
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 application uses DataContexts to query the database. You create a function that meets the following requirements:
- Updates the Customer table on the database when a customer is marked
as deleted.
- Updates the related entries in other tables (CustomerAddress,
CustomerContacts) by marking them as deleted.
- Prevents consumer code from setting the Deleted column's value
directly. You need to ensure that the function verifies that customers have no outstanding orders before they are marked as deleted. You also need to ensure that existing applications can use the update function without requiring changes in the code. What should you do?
Options
- AOverride the Delete operation of the DataContext object.
- BOverride the Update operation of the DataContext object.
- CModify the SELECT SQL statement provided to the DataContext object to use an INNER
- DAdd new entities to the DataContext object for the Customers and Orders tables.
How the community answered
(38 responses)- A82% (31)
- B3% (1)
- C11% (4)
- D5% (2)
Community Discussion
No community discussion yet for this question.