public ActionResult <TechniqueReadDto> GetTechniqueById(Guid id)
        {
            var techniqueItem = _repository.GetTechniqueById(id);

            // If found, return Model mapped as DTO object
            if (techniqueItem != null)
            {
                return(Ok(_mapper.Map <TechniqueReadDto>(techniqueItem)));
            }
            return(NotFound());
        }
        public ActionResult <CaseTechniqueCreateDto> CreateCaseTechnique(CaseTechniqueCreateDto caseTechniqueCreateDto)
        {
            // Map Dto to Model
            var caseTechniqueModel = _mapper.Map <CaseTechnique>(caseTechniqueCreateDto);

            var checkCaseId = _caserepository.GetCaseById(caseTechniqueModel.CaseId);

            if (checkCaseId == null)
            {
                return(NotFound("CaseId invalid"));
            }
            var checkTechniqueId = _techniquerepository.GetTechniqueById(caseTechniqueModel.TechniqueId);

            if (checkTechniqueId == null)
            {
                return(NotFound("TechniqueId invalid"));
            }

            _repository.CreateCaseTechnique(caseTechniqueModel);
            _repository.SaveChanges();

            var caseTechniqueReadDto = _mapper.Map <CaseTechniqueReadDto>(caseTechniqueModel);

            // CreatedAtRoute creates 201 created with specified values.
            return(CreatedAtRoute(nameof(GetCaseTechniqueById), new { Id = caseTechniqueReadDto.Id }, caseTechniqueReadDto));
        }