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"); } }
private void ValidatePrice(decimal price) { ValidateEditable(); var validator = new OfferPriceValidator(); var result = validator.Validate(price); if (!result.IsValid) { throw new OffersDomainException(nameof(Price)); } }