Пример #1
0
        public static MessageResponse GeneralValidation(MutantDnaRequest request)
        {
            var apiValidation = new MessageResponse();

            var cache = InvalidDnaCacheRapper.Instance;

            if (cache.IsInDnaInvalidCache(request.Dna.ToList().GetDeterministicHashCode()))
            {
                apiValidation.Success = false;
                apiValidation.Message = "ADN INVALIDO";
                return(apiValidation);
            }
            else
            {
                //NORMALIZACION DE DNAS
                var upperDna = DnaHelper.UpperDna(request.Dna.ToList());
                request.Dna = upperDna;


                //VALIDACION DE DNAS
                apiValidation = DnaValidator.ValidateDna(upperDna);

                if (apiValidation.Success == false)
                {
                    cache.AddToDnaInvalidCAche(request);
                }

                return(apiValidation);
            }
        }
Пример #2
0
 public MessageResponse GeneralValidation(MutantDnaRequest request)
 {
     return(DnaValidator.GeneralValidation(request));
 }