示例#1
0
        public DatabaseController(Lazy <IResetsDatabase> resetter,
                                  Lazy <IPerformsDatabaseUpgrades> upgrader,
                                  Lazy <IGetsDatabaseBackups> backupFinder,
                                  IGetsDatabaseMaintenanceSecurity securityProvider)
        {
            if (securityProvider == null)
            {
                throw new ArgumentNullException(nameof(securityProvider));
            }
            if (backupFinder == null)
            {
                throw new ArgumentNullException(nameof(backupFinder));
            }
            if (upgrader == null)
            {
                throw new ArgumentNullException(nameof(upgrader));
            }
            if (resetter == null)
            {
                throw new ArgumentNullException(nameof(resetter));
            }

            this.backupFinder     = backupFinder;
            this.securityProvider = securityProvider;
            this.resetter         = resetter;
            this.upgrader         = upgrader;
        }
示例#2
0
        public DatabaseBackupController(ITakesDatabaseBackup backupService,
                                        IRestoresDatabaseBackup backupRestorer,
                                        IGetsDatabaseMaintenanceSecurity securityProvider)
        {
            if (securityProvider == null)
            {
                throw new ArgumentNullException(nameof(securityProvider));
            }
            if (backupRestorer == null)
            {
                throw new ArgumentNullException(nameof(backupRestorer));
            }
            if (backupService == null)
            {
                throw new ArgumentNullException(nameof(backupService));
            }

            this.backupRestorer   = backupRestorer;
            this.securityProvider = securityProvider;
            this.backupService    = backupService;
        }