Пример #1
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="Rest.ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (ContactDetails != null)
     {
         ContactDetails.Validate();
     }
     if (ShippingAddress != null)
     {
         ShippingAddress.Validate();
     }
     if (KeyEncryptionKey != null)
     {
         KeyEncryptionKey.Validate();
     }
 }
Пример #2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (ContactDetails == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "ContactDetails");
     }
     if (ContactDetails != null)
     {
         ContactDetails.Validate();
     }
     if (ShippingAddress != null)
     {
         ShippingAddress.Validate();
     }
     if (DataImportDetails != null)
     {
         foreach (var element in DataImportDetails)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (DataExportDetails != null)
     {
         foreach (var element1 in DataExportDetails)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (Preferences != null)
     {
         Preferences.Validate();
     }
     if (KeyEncryptionKey != null)
     {
         KeyEncryptionKey.Validate();
     }
 }