예제 #1
0
        private static void ValidateOfferName(string offerName)
        {
            var validator = new OfferNameValidator();
            var result    = validator.Validate(offerName);

            if (!result.IsValid)
            {
                throw new CartsDomainException($"{nameof(OfferName)} is invalid offer name");
            }
        }
예제 #2
0
        public void ValidateOfferName(string offerName)
        {
            var validator = new OfferNameValidator();
            var result    = validator.Validate(offerName);

            if (!result.IsValid)
            {
                throw new OrdersDomainException($"'{nameof(offerName)}' is invalid name");
            }
        }
예제 #3
0
        private void ValidateName(string name)
        {
            ValidateEditable();

            var validator = new OfferNameValidator();
            var result    = validator.Validate(name);

            if (!result.IsValid)
            {
                throw new OffersDomainException(nameof(Name));
            }
        }