Example #1
0
        public async Task <Category> AddAsync(Category Entity)
        {
            await _dbContext.Categories.AddAsync(Entity);

            await _dbContext.SaveChangesAsync();

            return(await GetByIdAsync(Entity.CategoryId));
        }
Example #2
0
        public async Task <Product> AddAsync(Product Entity)
        {
            await _dbContext.Products.AddAsync(Entity);

            await _dbContext.SaveChangesAsync();

            var item = GetById(Entity.ProductId);

            return(item);
        }