Example #1
0
        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));
            }
        }
Example #2
0
 public IActionResult DeleteFruit(int Id)
 {
     return(View("Index", _service.Delete(Id)));
 }