public async Task Backup <T>(IBackupable <T> db) { var allDocs = await db.GetAllForBackup(); string json = JsonConvert.SerializeObject(allDocs); string backupName = db.GetBackupName(); CloudBlockBlob cloudBlockBlob = _backupsContainer.GetBlockBlobReference(backupName); await cloudBlockBlob.SnapshotAsync(); await cloudBlockBlob.UploadTextAsync(json); }
public async Task Restore <T>(IBackupable <T> db) { string backupName = db.GetBackupName(); await Restore <T>(backupName, db); }