欢迎来到易学考试网 易学考试官网
全部科目 > 微软认证考试 > MCTS > MCTS(70-515)

单项选择题

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.
You need to implement the UpdatePerson method to update the database row that corresponds to the personToEdit object. Which code segment should you use?()

    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(new Person() { Id = personToEdit.Id });_entities.ObjectStateManager.ChangeObjectState(personToEdit, EntityState.Modified);_entities.SaveChanges();

点击查看答案

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题