Microsoft
70-516 · Question #132
70-516 Question #132: Real Exam Question with Answer & Explanation
Sign in or unlock 70-516 to reveal the answer and full explanation for question #132. The question stem and answer options stay visible for context.
Question
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application uses the ADO.NET Entity Framework to model entities. The application includes a Customer entity along with a CustomerKey property of the Guid type as shown in the following exhibit: You discover that when the application adds a new instance of a Customer, calling the SaveChanges method results in the following error message: "Server generated keys are only supported for identity columns." You need to ensure that the application can add new Customer entities. What should you do?
Options
- AAdd a handler for the ObjectContext.SavingChanges event.
- BAdd a handler for the ObjectContext.ObjectMaterialized event.
- CCall the ObjectContext.Attach method before saving a Customer entity.
- DCall the ObjectContext.CreateEntityKey method before saving a Customer entity.
Unlock 70-516 to see the answer
You've previewed enough free 70-516 questions. Unlock 70-516 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.