public Task <int> InsertAsync <TEntity>(TEntity entity) where TEntity : class
        {
            dbcontext.Entry <TEntity>(entity).State = EntityState.Added;

            return(dbTransaction == null?this.CommitAsync() : Task.FromResult(0));
        }
Esempio n. 2
0
 public Task <int> InsertAsync(TEntity entity)
 {
     dbcontext.Entry <TEntity>(entity).State = EntityState.Added;
     return(dbcontext.SaveChangesAsync());
 }