public async Task <ActionResult> GetByName(string name) { var response = await _serviceCategoryService.GetServiceCategoryByName(name); if (response.StatusCode >= 400) { return(StatusCode(response.StatusCode, response)); } var serviceCategory = ((ApiOkResponse)response).Result; return(Ok(serviceCategory)); }