コード例 #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));
            }
        }