Beispiel #1
0
        public async Task <Category> AddAsync(Category newCategory, CancellationToken ct = default)
        {
            _context.Categories.Add(newCategory);
            await _context.SaveChangesAsync(ct);

            return(newCategory);
        }
Beispiel #2
0
        public async Task <Product> AddAsync(Product newProduct, CancellationToken ct = default)
        {
            _context.Products.Add(newProduct);
            await _context.SaveChangesAsync(ct);

            return(newProduct);
        }