public async Task <IHttpActionResult> Get(int categoryId) { try { var result = await _repo.GetCategoryByIdAsync(categoryId); if (result == null) { return(NotFound()); } return(Ok(_mapper.Map <CategoryModel>(result))); } catch (Exception ex) { return(InternalServerError(ex)); } }