nerdexam
Microsoft

70-515 · Question #141

70-515 Question #141: Real Exam Question with Answer & Explanation

The correct answer is A. ObjContext.SaveChanges(SaveOptions.DetectChangesBeforeSave);. See the full explanation below for the reasoning.

Question

You work as an ASP.NET Web Application Developer for SomeCompany. The company uses Visual Studio .NET 2010 as its application development platform. You create an ASP.NET Web application using .NET Framework 4.0. The Web application connects to a SQL Server database. You use the ADO.NET Entity Framework to handle persistence-ignorant entities. You create an ObjectContext object named ObjContext. Subsequently, you change properties on numerous entities. You are required to save the changed entity values in the SQL Server database. Which of the following code segments will you use?

Options

  • AObjContext.SaveChanges(SaveOptions.DetectChangesBeforeSave);
  • BObjContext.SaveChanges(SaveOptions.AcceptAllChangesAfterSave);
  • CObjContext.SaveChanges(SaveOptions.All);
  • DObjContext.SaveChanges(SaveOptions.None);

Community Discussion

No community discussion yet for this question.

Full 70-515 Practice