public Order CreateOrder(Order order) { if (order == null) { throw new ArgumentNullException(nameof(order)); } if (order.Id != default(long)) { throw new ArgumentOutOfRangeException(nameof(order.Id)); } _context.Orders.Add(order); _context.SaveChanges(); return(order); }
public Supplier CreateSupplier(Supplier supplier) { if (supplier == null) { throw new ArgumentNullException(nameof(supplier)); } if (supplier.Id != default(long)) { throw new ArgumentOutOfRangeException(nameof(supplier.Id)); } _context.Suppliers.Add(supplier); _context.SaveChanges(); return(supplier); }
public Product CreateProduct(Product product) { if (product == null) { throw new ArgumentNullException(nameof(product)); } if (product.Id != default(long)) { throw new ArgumentOutOfRangeException(nameof(product.Id)); } _context.Products.Add(product); _context.SaveChanges(); return(product); }
public Customer CreateCustomer(Customer customer) { if (customer == null) { throw new ArgumentNullException(nameof(customer)); } if (customer.Id != default(long)) { throw new ArgumentOutOfRangeException(nameof(customer.Id)); } _context.Customers.Add(customer); _context.SaveChanges(); return(customer); }