예제 #1
0
        /// <inheritdoc/>
        public async Task <Product> InsertAsync(Product product)
        {
            await _avertoryDbContext.Products.AddAsync(product);

            // Unit of work?
            await _avertoryDbContext.SaveChangesAsync();

            return(product);
        }
예제 #2
0
        /// <inheritdoc/>
        public async Task <Inventory> InsertAsync(Inventory inventory)
        {
            await _avertoryDbContext.Inventories.AddAsync(inventory);

            await _avertoryDbContext.SaveChangesAsync();

            return(inventory);
        }
예제 #3
0
        /// <inheritdoc/>
        public async Task InsertItemsAsync(IEnumerable <Item> items)
        {
            await _avertoryDbContext.Items.AddRangeAsync(items);

            await _avertoryDbContext.SaveChangesAsync();
        }