示例#1
0
 public void Update(T entity)
 {
     _dbSet.Attach(entity);
     _dataDbContext.Entry(entity).State = EntityState.Modified;
     Save();
 }
示例#2
0
 public void Update(T entity)
 {
     dbContext.Entry(entity).State = System.Data.Entity.EntityState.Modified;
 }
示例#3
0
 public bool InsertAttach(T t)
 {
     if (t != null)
     {
         DbSet.Attach(t);
         BaseContext.Entry(t).State = EntityState.Added;
         return(Save());
     }
     return(_flag);
 }
示例#4
0
 public void Update(TEntity item)
 {
     _context.Entry(item).State = EntityState.Modified;
     _context.SaveChanges();
 }
示例#5
0
 public void Update(T entity)
 {
     dbContext.Entry(entity).State = EntityState.Modified;
     Save();
 }
示例#6
0
 /// <summary>
 /// Új elem hozzáadása.
 /// </summary>
 /// <param name="entityToAdd"></param>
 public void Add(TEntity entityToAdd)
 {
     Context.Set <TEntity>().Add(entityToAdd);
     Context.Entry <TEntity>(entityToAdd).State = EntityState.Added;
     SaveChanges();
 }