Example #1
0
        public void ValidatePricePerItem(decimal pricePerItem)
        {
            var validator = new OfferPriceValidator();
            var result    = validator.Validate(pricePerItem);

            if (!result.IsValid)
            {
                throw new OrdersDomainException($"'{nameof(pricePerItem)}' is invalid price");
            }
        }
Example #2
0
        private void ValidatePrice(decimal price)
        {
            ValidateEditable();

            var validator = new OfferPriceValidator();
            var result    = validator.Validate(price);

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