public Product AddProduct(Product product) { if (product.Category != null && product.CategoryId == 0) { context.Categories.Add(product.Category); } context.Products.Add(product); context.SaveChanges(); return(product); }
public Promotion AddPromotion(Promotion promotion) { context.Promotions.Add(promotion); context.SaveChanges(); return(promotion); }
public OrderDetail AddOrderDetail(OrderDetail orderDetail) { context.OrderDetails.Add(orderDetail); context.SaveChanges(); return(orderDetail); }
public Order AddOrder(Order order) { context.Orders.Add(order); context.SaveChanges(); return(order); }
public Category AddCategory(Category Category) { context.Categories.Add(Category); context.SaveChanges(); return(Category); }