public async Task <IActionResult> GetSpecifications(long catId) { try { var specs = await _specificaionRepo.GetSpecificationsByCategory(catId); if (specs.Any()) { return(Ok(_mapper.Map <IEnumerable <Specification>, IEnumerable <SpecificationDTO> >(specs))); } else { return(NotFound()); } } catch (Exception ex) { throw new Exception(ex.Message); } }