public async Task Insert(Stock stock) { try { _context.Stock.Add(stock); await _context.SaveChangesAsync(); } catch (Exception e) { throw new Exception(e.Message); } }
public async Task InsertAsync(Models.DiscountStock discountStock) { try { _context.DiscountStock.Add(discountStock); await _context.SaveChangesAsync(); } catch (Exception e) { throw new Exception(e.Message); } }
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); } }