nerdexam
Microsoft

70-516 · Question #133

70-516 Question #133: Real Exam Question with Answer & Explanation

Sign in or unlock 70-516 to reveal the answer and full explanation for question #133. 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. You use the ADO.NET Entity Framework to model entities. The application connects to a Microsoft SQL Server database named AdventureWorks. The application includes the following code segment. (Line numbers are included for reference only.) 01 using (AdventureWorksEntities context = new AdventureWorksEntities()) 02 { 03 ObjectQuery <SalesOrderHeader> orders = context.SalesOrderHeader. Where("it.CreditCardApprovalCode IS NULL").Top("100"); 04 foreach (SalesOrderHeader order in orders){ 05 order.Status = 4; 06 } 07 try { 08 context.SaveChanges(); 09 } 10 catch (OptimisticConcurrencyException){ 11 ... 12 } 13 } You need to resolve any concurrency conflict that can occur. You also need to ensure that local changes are persisted to the database. Which code segment should you insert at line 11?

Options

  • Acontext.Refresh(RefreshMode.ClientWins, orders);
  • Bcontext.Refresh(RefreshMode.ClientWins, orders);
  • Ccontext.Refresh(RefreshMode.StoreWins, orders);
  • Dcontext.Refresh(RefreshMode.StoreWins, orders);

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.

Full 70-516 Practice