Пример #1
0
 public virtual TEntity Update(TEntity entity)
 {
     dbSet.Attach(entity);
     context.Entry(entity).State = EntityState.Modified;
     context.SaveChanges();
     return(entity);
 }
Пример #2
0
        public virtual int Update <T>(T TObject) where T : class
        {
            var entry = dbContext.Entry(TObject);

            dbContext.Set <T>().Attach(TObject);
            entry.State = EntityState.Modified;
            return(dbContext.SaveChanges());
        }
Пример #3
0
 public void Update(T entity)
 {
     //table.Attach(entity);
     db.Entry(entity).State = EntityState.Modified;
     db.SaveChanges();
 }