void IStockRepository.LoadStock(List <StockDetail> stock) { using (YEXDBContext context = new YEXDBContext()) { foreach (var eachStock in stock) { context.stocks.Add(eachStock); } context.SaveChanges(); } }
void IStockRepository.SaveOrder(OrderDetail orderDetail) { try { using (YEXDBContext context = new YEXDBContext()) { context.orderHistory.Add(orderDetail); context.SaveChanges(); } } catch (Exception ex) { // handle log } }