News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Advertisement

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;
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?

  1. _entities.People.Attach(personToEdit);
    _entities.ObjectStateManager.ChangeObjectState(
    personToEdit,
    EntityState.Modified);
    _entities.SaveChanges();
    
  2. _entities.ObjectStateManager.ChangeObjectState(
    personToEdit,
    EntityState.Added);
    _entities.SaveChanges();
    
  3. _entities.People.ApplyCurrentValues(personToEdit);
    _entities.SaveChanges();
    
  4. _entities.People.Attach(new Person() { Id = personToEdit.Id }); _entities.ObjectStateManager.
    ChangeObjectState(
    personToEdit,
    EntityState.Modified);
    _entities.SaveChanges();
    
Answer: Answer is a
comments powered by Disqus
Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;