public Variation ConvertDTOToEntity(VariationDetail_VariationDTO VariationDetail_VariationDTO)
        {
            Variation Variation = new Variation();

            Variation.Id   = VariationDetail_VariationDTO.Id;
            Variation.Name = VariationDetail_VariationDTO.Name;
            Variation.VariationGroupingId = VariationDetail_VariationDTO.VariationGroupingId;
            return(Variation);
        }
        public async Task <VariationDetail_VariationDTO> Get([FromBody] VariationDetail_VariationDTO VariationDetail_VariationDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new MessageException(ModelState);
            }

            Variation Variation = await VariationService.Get(VariationDetail_VariationDTO.Id);

            return(new VariationDetail_VariationDTO(Variation));
        }
        public async Task <ActionResult <VariationDetail_VariationDTO> > Update([FromBody] VariationDetail_VariationDTO VariationDetail_VariationDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new MessageException(ModelState);
            }

            Variation Variation = ConvertDTOToEntity(VariationDetail_VariationDTO);

            Variation = await VariationService.Update(Variation);

            VariationDetail_VariationDTO = new VariationDetail_VariationDTO(Variation);
            if (Variation.IsValidated)
            {
                return(VariationDetail_VariationDTO);
            }
            else
            {
                return(BadRequest(VariationDetail_VariationDTO));
            }
        }