Beispiel #1
0
        public static RawContainerIdentification Validate(UnvalidatedRawContainerIdentification unvalidatedRawContainerIdentification)
        {
            var isValid = Utilities.TryValidate(unvalidatedRawContainerIdentification, out var rawContainerIdentification);

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

            return(rawContainerIdentification);
        }
Beispiel #2
0
        public static DescribedResult <bool> TryValidate(UnvalidatedRawContainerIdentification unvalidatedRawContainerIdentification, out RawContainerIdentification rawContainerIdentification)
        {
            var isValid = Utilities.IsValid(unvalidatedRawContainerIdentification);

            if (isValid.Value)
            {
                rawContainerIdentification = new RawContainerIdentification(unvalidatedRawContainerIdentification.Value);
            }
            else
            {
                rawContainerIdentification = RawContainerIdentification.Invalid;
            }

            return(isValid);
        }
Beispiel #3
0
        public static DescribedResult <bool> IsValid(UnvalidatedRawContainerIdentification unvalidatedRawContainerIdentification)
        {
            var output = Utilities.IsValidRawContainerIdentification(unvalidatedRawContainerIdentification.Value);

            return(output);
        }