public async Task <IActionResult> Create([Bind("Milliliter,IsFrozen,ProductID,Name,Price,Description,Stockpiled")] Dessert dessert) { if (ModelState.IsValid) { _context.Add(dessert); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dessert)); }
public async Task <IActionResult> Create([Bind("Milliliter,IsCarbonated,ProductID,Name,Price,Description,Stockpiled")] Beverage beverage) { if (ModelState.IsValid) { _context.Add(beverage); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(beverage)); }
public async Task <IActionResult> Create([Bind("BasketCardId,CreatedOn,IsActive,ShippingAmount")] BasketCard basketCard) { if (ModelState.IsValid) { _context.Add(basketCard); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(basketCard)); }
public async Task <IActionResult> Create([Bind("Weight,SaltWeight,ProductID,Name,Price,Description,Stockpiled")] Side side) { if (ModelState.IsValid) { _context.Add(side); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(side)); }
public async Task <IActionResult> Create([Bind("Id,Discount,Comments,DateCreated,DateModified,IsValidate,CustomerId,CreatedBy,UpdatedBy,UpdatedDate,CreatedDate")] Order order) { if (ModelState.IsValid) { _context.Add(order); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CustomerId"] = new SelectList(_context.Customers, "PersonId", "Discriminator", order.CustomerId); return(View(order)); }