Пример #1
0
 public void Update(Department entity)
 {
     using (var contosoDbContent = new ContosoDbContext())
     {
         contosoDbContent.Departments.Attach(entity);
         contosoDbContent.Entry(entity).State = EntityState.Modified;
         contosoDbContent.SaveChanges();
     }
 }
Пример #2
0
 public void Update(T entity)
 {
     dbSet.Attach(entity);
     _context.Entry(entity).State = EntityState.Modified;
 }
Пример #3
0
 public void Update(T entity)
 {
     _dbSet.Attach(entity);
     _db.Entry(entity).State = EntityState.Modified;
 }
Пример #4
0
 public virtual void Update(T entity)
 {
     _dbContext.Entry(entity).State = EntityState.Modified;
 }
Пример #5
0
 public virtual void Update(T entity)
 {
     _dbContext.Entry(entity).State = EntityState.Modified;// change the state of entity to be modified?
 }