网友您好, 请在下方输入框内输入要搜索的题目:
YouareimplementinganASP.NETapplicationthatusesLINQtoEntitiestoaccessandupdatethedatabase.TheapplicationincludesthefollowingmethodtoupdateadetachedentityoftypePerson.YouneedtoimplementtheUpdatePersonmethodtoupdatethedatabaserowthatcorrespondstothepersonToEditobject.Whichcodesegmentshouldyouuse?()
A._entities.People.Attach(personToEdit);_entities.ObjectStateManager.ChangeObjectState(personToEdit,EntityState.Modified);_entities.SaveChanges();
B._entities.ObjectStateManager.ChangeObjectState(personToEdit,EntityState.Added);_entities.SaveChanges();
C._entities.People.ApplyCurrentValues(personToEdit);_entities.SaveChanges();
D._entities.People.Attach(newPerson(){Id=personToEdit.Id});_entities.ObjectStateManager.ChangeObjectState(personToEdit,EntityState.Modified);_entities.SaveChanges();
参考答案