Ejemplo n.º 1
0
        public static RawCheckedContainerIdentification Validate(UnvalidatedRawCheckedContainerIdentification unvalidatedRawCheckedContainerIdentification)
        {
            var isValid = Utilities.TryValidate(unvalidatedRawCheckedContainerIdentification, out var rawCheckedContainerIdentification);

            if (!isValid.Value)
            {
                throw new ArgumentException(isValid.Message, nameof(unvalidatedRawCheckedContainerIdentification));
            }

            return(rawCheckedContainerIdentification);
        }
Ejemplo n.º 2
0
        public static DescribedResult <bool> TryValidate(UnvalidatedRawCheckedContainerIdentification unvalidatedRawCheckedContainerIdentification, out RawCheckedContainerIdentification rawCheckedContainerIdentification)
        {
            var isValid = Utilities.IsValid(unvalidatedRawCheckedContainerIdentification);

            if (isValid.Value)
            {
                rawCheckedContainerIdentification = new RawCheckedContainerIdentification(unvalidatedRawCheckedContainerIdentification.Value);
            }
            else
            {
                rawCheckedContainerIdentification = RawCheckedContainerIdentification.Invalid;
            }

            return(isValid);
        }
Ejemplo n.º 3
0
        public static DescribedResult <bool> IsValid(UnvalidatedRawCheckedContainerIdentification unvalidatedRawCheckedContainerIdentification)
        {
            var output = Utilities.IsValidRawCheckedContainerIdentification(unvalidatedRawCheckedContainerIdentification.Value);

            return(output);
        }