Microsoft
70-515 · Question #159
70-515 Question #159: Real Exam Question with Answer & Explanation
Sign in or unlock 70-515 to reveal the answer and full explanation for question #159. The question stem and answer options stay visible for context.
Question
You are implementing an ASP.NET application that uses LINQ to Entities to access and update the database. The application includes the following method to update a detached entity of type Person. private NorthwindContext _entities; public void UpdatePerson(Person personToEdit) { } You need to implement the UpdatePerson method to update the database row that corresponds to the personToEdit object. Which code segment should you use?
Options
- A_entities.People.Attach(personToEdit);
- B_entities.ObjectStateManager.ChangeObjectState(personToEdit,
- C_entities.People.ApplyCurrentValues(personToEdit);
- D_entities.People.Attach(new Person() { Id = personToEdit.Id });
Unlock 70-515 to see the answer
You've previewed enough free 70-515 questions. Unlock 70-515 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.