예제 #1
0
        public void RestoreFromSnapshot(Snapshot snapshot)
        {
            if (snapshot == null)
            {
                throw new ArgumentNullException(nameof(snapshot));
            }

            var dataFile = dbFileProvider.GetDatabaseFile();

            fileService.Replace(snapshot.File, dataFile);

            logger.Debug($"Restored database {dataFile.Name} using {snapshot.File.Name}");
        }
예제 #2
0
        public void RestoreDatabaseBackup(string backupFilenameToRestore)
        {
            var backupFile = backupFileProvider.GetBackupFileFromFilename(backupFilenameToRestore);
            var dbFile     = fileProvider.GetDatabaseFile();

            fileService.Replace(backupFile, dbFile);
        }
예제 #3
0
        public void TakeDatabaseBackup(string name)
        {
            var backupFile = backupFileProvider.GetBackupFileFromBackupName(name);
            var dbFile     = dbFileProvider.GetDatabaseFile();

            snapshotFileService.Copy(dbFile, backupFile);
        }