Exemple #1
0
        internal BackupRestoreView.BackupPolicy ToBackupPolicyView()
        {
            BackupRestoreView.BackupPolicy backupPolicyView = new BackupRestoreView.BackupPolicy
            {
                Name = this.Name,
                AutoRestoreOnDataLoss = this.AutoRestore,
                Schedule = this.BackupSchedule.ToBackupScheduleView(),
                Storage  = this.Storage.ToBackupStorageView(),
                MaxIncrementalBackups = this.MaxIncrementalBackup,
                RetentionPolicy       = RetentionPolicy.ToRetentionPolicyView(this.RetentionPolicy)
            };

            return(backupPolicyView);
        }
Exemple #2
0
        internal static BackupPolicy FromBackupPolicyView(BackupRestoreView.BackupPolicy backupPolicyView)
        {
            backupPolicyView.ThrowIfNull("BackupPolicy");
            BackupPolicy backupPolicy = new BackupPolicy
            {
                Name                 = backupPolicyView.Name,
                AutoRestore          = backupPolicyView.AutoRestoreOnDataLoss,
                MaxIncrementalBackup = backupPolicyView.MaxIncrementalBackups,
                BackupSchedule       = BackupSchedule.FromBackupScheduleView(backupPolicyView.Schedule),
                Storage              = BackupStorage.FromBackupStorageView(backupPolicyView.Storage),
                RetentionPolicy      = RetentionPolicy.FromRetentionPolicyView(backupPolicyView.RetentionPolicy)
            };

            return(backupPolicy);
        }