public ValidationMessageCollection Assert(params object[] dependentServices) { if (InvariantValidation == null) { throw new ContosoUniversityException("InvariantSpecification cannot be null"); } if (ContextualValidation == null) { throw new ContosoUniversityException("ValidationSpecification cannot be null"); } // Check invariant stuff first InvariantValidation.Validate(dependentServices); return(ContextualValidation.Validate(dependentServices)); }
public Request(string userId, CommandModel commandModel) : base(userId, commandModel) { InvariantValidation = new InvariantValidation(this); ContextualValidation = new ContextualValidation(this); }