/// <inheritdoc />
        public void Commit()
        {
            if (_disposed)
            {
                throw new ObjectDisposedException(nameof(UnitOfWork));
            }

            _context?.SaveChanges();
        }
예제 #2
0
 public void Create(Comments e)
 {
     context.Set <ORM.Comments>().Add(e);
     context.SaveChanges();
 }
예제 #3
0
 //增
 public int Add(T s)
 {
     dbContext.Set <T>().Add(s);
     return(dbContext.SaveChanges());
 }
예제 #4
0
 //C
 public int AddEntity(T entity)
 {
     dbContext.Set <T>().Add(entity);
     return(dbContext.SaveChanges());
 }
 public void Save() => _dbContext.SaveChanges();
예제 #6
0
 /// <summary>
 /// 提交SQL
 /// </summary>
 /// <returns></returns>
 public int SaveChanges()
 {
     return(db.SaveChanges());
 }
예제 #7
0
 /// <summary>
 /// Saves the context
 /// </summary>
 public void Save()
 {
     Context.SaveChanges();
 }
예제 #8
0
 public bool SaveChanges()
 {
     return(dbContext.SaveChanges() > 0);
 }
예제 #9
0
 public void Commit()
 {
     db.SaveChanges();
 }
예제 #10
0
 public void Commit()
 {
     context.SaveChanges();
 }