示例#1
0
        public async Task Add(T entity)
        {
            // await _context.AddAsync(entity);
            await _context.Set <T>().AddAsync(entity);

            await _context.SaveChangesAsync();
        }
示例#2
0
 public async Task AddAsync(TEntity entity)
 {
     EntityDbSet.Add(entity);
     await EntityContext.SaveChangesAsync();
 }