/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public override void Validate() { base.Validate(); if (SelectedDatabases == null) { throw new ValidationException(ValidationRules.CannotBeNull, "SelectedDatabases"); } if (BackupBlobShare == null) { throw new ValidationException(ValidationRules.CannotBeNull, "BackupBlobShare"); } if (SelectedDatabases != null) { foreach (var element in SelectedDatabases) { if (element != null) { element.Validate(); } } } if (BackupFileShare != null) { BackupFileShare.Validate(); } if (BackupBlobShare != null) { BackupBlobShare.Validate(); } }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (SourceConnectionInfo == null) { throw new ValidationException(ValidationRules.CannotBeNull, "SourceConnectionInfo"); } if (TargetConnectionInfo == null) { throw new ValidationException(ValidationRules.CannotBeNull, "TargetConnectionInfo"); } if (SelectedDatabases == null) { throw new ValidationException(ValidationRules.CannotBeNull, "SelectedDatabases"); } if (BackupBlobShare == null) { throw new ValidationException(ValidationRules.CannotBeNull, "BackupBlobShare"); } if (SourceConnectionInfo != null) { SourceConnectionInfo.Validate(); } if (TargetConnectionInfo != null) { TargetConnectionInfo.Validate(); } if (SelectedDatabases != null) { foreach (var element in SelectedDatabases) { if (element != null) { element.Validate(); } } } if (BackupFileShare != null) { BackupFileShare.Validate(); } if (BackupBlobShare != null) { BackupBlobShare.Validate(); } }