public IHttpActionResult DoImport(StoreImportConfiguration importConfiguration) { var notification = new ImportNotification(CurrentPrincipal.GetCurrentUserName()) { Title = "Import store task", Description = "starting import...." }; _notifier.Upsert(notification); var importJob = new BackupStoreJob(); BackgroundJob.Enqueue(() => importJob.DoImport(importConfiguration, notification)); return(Ok(notification)); }
public IHttpActionResult DoExport(StoreExportConfiguration exportConfiguration) { var notification = new ExportNotification(CurrentPrincipal.GetCurrentUserName()) { Title = "Store export task", Description = "starting export...." }; _notifier.Upsert(notification); var store = _storeService.GetById(exportConfiguration.StoreId); if (store == null) { throw new NullReferenceException("store"); } var backupStoreJob = new BackupStoreJob(); BackgroundJob.Enqueue(() => backupStoreJob.DoExport(exportConfiguration, notification)); return(Ok(notification)); }