public async Task <IActionResult> GetCategory(Guid id) { if (!ModelState.IsValid) { return(BadRequest(ModelState.GetErrorMessages())); } try { var response = await _foodCategorySerive.GetById(id); return(Ok(response)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IActionResult GetById(int id) { var model = _foodCategoryService.GetById(id, out bool result, out string message); return(new OkObjectResult(new GenericResult(result, message, model))); }