Exemple #1
0
 public async Task Insert(Stock stock)
 {
     try
     {
         _context.Stock.Add(stock);
         await _context.SaveChangesAsync();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Exemple #2
0
 public async Task InsertAsync(Models.DiscountStock discountStock)
 {
     try
     {
         _context.DiscountStock.Add(discountStock);
         await _context.SaveChangesAsync();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Exemple #3
0
        public async Task InsertAsync(SaleBox saleBox)
        {
            try
            {
                await _context.SaleBox.AddAsync(saleBox);

                await _context.SaveChangesAsync();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
        public async Task DeleteAsync(int id)
        {
            try
            {
                City city = await FindByIdAsync(id);

                _context.City.Remove(city);
                await _context.SaveChangesAsync();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }