示例#1
0
        public virtual async Task <TEntity> AddAsync(TEntity entity)
        {
            if (entity == null)
            {
                return(null);
            }

            try
            {
                await DbContext.Set <TEntity>().AddAsync(entity);

                return(entity);
            }
            catch (Exception ex) { throw ex; }
        }
 public Repository(HolidaysContext context)
 {
     Db    = context;
     DbSet = Db.Set <TEntity>();
 }