public IActionResult GetAllSubCategories() { try { var resp = _mapper.Map <List <SubCategoryDTO> >(_subCategoryServices.GetAllSubCategories()); if (resp == null) { return(NotFound(resp)); } return(Ok(resp)); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, new { message = e.Message })); } }