public IActionResult Delete(int id) { try { var restaurante = _restauranteService.GetById(id); if (restaurante == null) { return(NotFound()); } _restauranteService.Delete(restaurante); return(Ok("Removido!")); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IActionResult Get() { var data = _pratoService.GetAll(x => x.Id > 0); foreach (var item in data) { item.Restaurante = _restauranteService.GetById(item.RestauranteId); } return(new OkObjectResult(data)); }