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"); } }
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"); } }
private void ValidateName(string name) { ValidateEditable(); var validator = new OfferNameValidator(); var result = validator.Validate(name); if (!result.IsValid) { throw new OffersDomainException(nameof(Name)); } }