Exemplo n.º 1
0
        public IdentityModelTests()
        {
            this.model = DataAccessModel.BuildDataAccessModel <IdentityModel>(SqliteConfiguration.Create(":memory:", null, BaseTests <IdentityModel> .useMonoData));
            this.model.Create(DatabaseCreationOptions.IfDatabaseNotExist);

            this.userStore = new ShaolinqIdentityUserStore <ShaolinqIdentityUser <Guid>, IdentityModel, Guid, DbUser, DbUserLogin, DbUserClaim, DbUserRole>(this.model);
        }
        private ISession CreateTestSession()
        {
            var session = sqliteConfiguration.Create(":memory:").CreateSchemaInMemory().Session;

            sessionHelper = new SessionHelper(session);
            return(session);
        }
Exemplo n.º 3
0
        static AuthDatabase()
        {
            var config = Config.Instance.AuthDatabase;

            DataAccessModelConfiguration dbConfig;

            switch (Config.Instance.AuthDatabase.Engine)
            {
            case DatabaseEngine.MySQL:
                dbConfig = MySqlConfiguration.Create(config.Database, config.Host, config.Username, config.Password, true);
                break;

            case DatabaseEngine.SQLite:
                dbConfig = SqliteConfiguration.Create(config.Filename, null);
                break;

            default:
                Logger.Error()
                .Message("Invalid database engine {0}", Config.Instance.AuthDatabase.Engine)
                .Write();
                Environment.Exit(0);
                return;
            }

            Instance = DataAccessModel.BuildDataAccessModel <Database.Auth.AuthDatabase>(dbConfig);
        }
Exemplo n.º 4
0
        protected DataAccessModelConfiguration CreateSqliteConfiguration(string databaseName)
        {
            var retval = SqliteConfiguration.Create(databaseName + ".db", null, useMonoData);

            retval.AlwaysSubmitDefaultValues               = this.alwaysSubmitDefaultValues;
            retval.ValueTypesAutoImplicitDefault           = this.valueTypesAutoImplicitDefault;
            retval.SaveAndReuseGeneratedAssemblies         = true;
            retval.SqlDatabaseContextInfos[0].SqlDataTypes = new List <Type> {
                typeof(SqlFixedDateDataType)
            };

            return(retval);
        }
Exemplo n.º 5
0
 protected DataAccessModelConfiguration CreateSqliteClassicInMemoryConfiguration(string databaseName)
 {
     return(SqliteConfiguration.Create(":memory:", null, useMonoData));
 }
Exemplo n.º 6
0
 protected DataAccessModelConfiguration CreateSqliteInMemoryConfiguration(string databaseName)
 {
     return(SqliteConfiguration.Create("file:" + databaseName + "?mode=memory&cache=shared", null, useMonoData));
 }
Exemplo n.º 7
0
 protected DataAccessModelConfiguration CreateSqliteConfiguration(string databaseName)
 {
     return(SqliteConfiguration.Create(databaseName + ".db", null, useMonoData));
 }
Exemplo n.º 8
0
        public void TestCreateDataAccessModel()
        {
            var dataModel = DataAccessModel.BuildDataAccessModel <IdentityServerDataAccessModel>(SqliteConfiguration.Create(":memory:", null));

            dataModel.Create(DatabaseCreationOptions.DeleteExistingDatabase);
        }