public IActionResult Run() { string databaseName = _databaseName.For(UserId); #region Demo try { #region Step_1 DatabaseRecord databaseRecord = new DatabaseRecord(databaseName); CreateDatabaseOperation createDatabaseOperation = new CreateDatabaseOperation(databaseRecord); #endregion #region Step_2 DocumentStoreHolder.Store.Maintenance.Server.Send(createDatabaseOperation); #endregion } catch (ConcurrencyException) { // Database already exists } #endregion return(Ok($"Database {databaseName} was created successfully")); }
public string ToUserDocuments(Guid userId) { var databaseName = _databaseName.For(userId); return(GetDocumentsUrl(databaseName)); }
protected override string GetDatabaseName(Guid userId) => _databaseName.For(userId);