public IActionResult Delete(Guid id) { try { if (_fruitService.GetById(id) == null) { return(BadRequest("Fruta não encontrado")); } _fruitService.Delete(id); return(Ok()); } catch (Exception ex) { return(StatusCode(500, ex.Message)); } }
public IActionResult DeleteFruit(int Id) { return(View("Index", _service.Delete(Id))); }