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"));
        }
Beispiel #2
0
        public string ToUserDocuments(Guid userId)
        {
            var databaseName = _databaseName.For(userId);

            return(GetDocumentsUrl(databaseName));
        }
Beispiel #3
0
 protected override string GetDatabaseName(Guid userId) => _databaseName.For(userId);