public async Task <IActionResult> Create([Bind("Id,Name,PriceS,PriceM,PriceL,Crust")] Pizza pizza) { if (ModelState.IsValid) { _context.Add(pizza); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(pizza)); }
public async Task <IActionResult> Create([Bind("Id,Name,RowVersion")] Ingredient ingredient) { if (ModelState.IsValid) { _context.Add(ingredient); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ingredient)); }
public async Task <IActionResult> Create([Bind("Id,PizzaName,Price")] OurPizzas ourPizzas) { if (ModelState.IsValid) { _context.Add(ourPizzas); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ourPizzas)); }
public void Add(AStore genericType) { context.Add(mapperStore.Map(genericType)); context.SaveChanges(); }