public Create ( string adminName, string identification, string token ) : void | ||
adminName | string | The name of the administrator. |
identification | string | The name of the mechanism used to identify the user by the /// given token. |
token | string | The toke used to identify the administrator, using the
/// |
Résultat | void |
protected virtual IDatabase CreateDatabase(IDatabaseContext context) { var database = new Database(context); database.Create(AdminUserName, AdminPassword); database.Open(); return database; }
public void TestSetup() { testSequenceName = ObjectName.Parse("APP.test_sequence"); var dbConfig = Configuration.Configuration.Empty; dbConfig.SetValue(DatabaseConfigKeys.DatabaseName, "testdb"); var systemContext = new SystemContext(Configuration.Configuration.SystemDefault); var dbContext = new DatabaseContext(systemContext, dbConfig); var database = new Database(dbContext); database.Create("SA", "12345"); database.Open(); transaction = database.CreateTransaction(TransactionIsolation.Serializable); if (TestContext.CurrentContext.Test.Name != "CreateNormalSequence") { var seqInfo = new SequenceInfo(testSequenceName, new SqlNumber(0), new SqlNumber(1), new SqlNumber(0), new SqlNumber(Int64.MaxValue), 126); transaction.CreateSequence(seqInfo); } }
public IDatabase CreateDatabase(IConfiguration configuration, string adminUser, string identification, string token) { lock (this) { if (configuration == null) throw new ArgumentNullException("configuration"); var databaseName = configuration.GetString("database.name"); if (String.IsNullOrEmpty(databaseName)) throw new ArgumentException("The configuration must specify a database name."); if (DatabaseExists(databaseName)) throw new InvalidOperationException(String.Format("Database '{0}' already exists in the system.", databaseName)); var dbContext = Context.CreateDatabaseContext(configuration); var database = new Database(this, dbContext); if (database.Exists) throw new InvalidOperationException(String.Format("The database '{0}' was already created.", databaseName)); database.Create(adminUser, identification, token); database.Open(); if (databases == null) databases = new Dictionary<string, Database>(); databases[databaseName] = database; return database; } }