Example #1
0
        public async Task <int> CreateAsync(TEntity model)
        {
            if (model == null)
            {
                throw new ArgumentNullException();
            }

            await dbContext.Set <TEntity>().AddAsync(model);

            await dbContext.SaveChangesAsync();

            return(model.Id);
        }