Example #1
0
        public async Task <int> Add(T entity)
        {
            if (entity == null)
            {
                throw new NullReferenceException("entity not initialized");
            }
            await Context.Set <T>().AddAsync(entity);

            return(await Context.SaveChangesAsync());
        }