public async Task <ActionResult <Category> > GetByIdAsync(int id)
        {
            var existingCategory = await _queries.FindByIdAsync(id);

            if (existingCategory == null)
            {
                return(NotFound());
            }

            return(existingCategory);
        }
        public async Task <ActionResult <SpecificationViewModel> > CreateSpecificationAsync(CreateSpecificationCommand createSpecificationCommand)
        {
            var existingCategory = await _categoryQueries.FindByIdAsync(createSpecificationCommand.CategoryId);

            if (existingCategory == null)
            {
                return(NotFound());
            }

            var specification = _mapper.Map <Specification>(createSpecificationCommand);

            await _behavior.CreateSpecificationAsync(specification);

            var specificationViewModel = await _queries.FindByIdAsync(specification.Id);

            return(specificationViewModel);
        }