Beispiel #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (ConsentId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ConsentId");
     }
     if (Initiation == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Initiation");
     }
     if (Charges != null)
     {
         foreach (var element in Charges)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (ExchangeRateInformation != null)
     {
         ExchangeRateInformation.Validate();
     }
     if (Initiation != null)
     {
         Initiation.Validate();
     }
     if (Authorisation != null)
     {
         Authorisation.Validate();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Initiation == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Initiation");
     }
     if (Initiation != null)
     {
         Initiation.Validate();
     }
     if (Authorisation != null)
     {
         Authorisation.Validate();
     }
 }