public IActionResult Edit(int id, CreatePartsModel model) { if (!ModelState.IsValid) { return(View(model)); } this.parts.Edit( id, model.Name, model.Price, model.Quantity ); return(RedirectToAction(nameof(All))); }
public IActionResult Delete(int id, CreatePartsModel model) { this.parts.Delete(id); return(RedirectToAction(nameof(All))); }