public async Task <IActionResult> DeletePizzaAsync(Guid id) { if (await _pizzaRepo.RemovePizzaAsync(id)) { return(NoContent()); } else { return(NotFound()); } }
public async Task <IActionResult> Delete(Guid id, IFormCollection collection) { try { if (!await _pizzaRepo.RemovePizzaAsync(id)) { return(BadRequest()); } return(RedirectToAction(nameof(Index))); } catch { return(View()); } }