网友您好, 请在下方输入框内输入要搜索的题目:
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();
参考答案
更多 “ 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(); ” 相关考题
![瑞牛题库 章节练习 历年真题 模拟试卷](http://assets.51tk.com/51_sidebar_right_index.jpg)