Exemplo n.º 1
0
        private IConnectionFactory GetConnectionFactory()
        {
            var connectionString = _storage.ConnectionString;

            var factory = new TestConnectionFactory(new SQLiteDataProvider(), "RoleStoreTest", connectionString);

            factory.CreateTables <LinqToDB.Identity.IdentityUser, LinqToDB.Identity.IdentityRole, string>();
            return(factory);
        }
Exemplo n.º 2
0
        public DefaultPocoTest(ScratchDatabaseFixture fixture)
        {
            var services = new ServiceCollection();

            var factory = new TestConnectionFactory(_dataProvider, nameof(DefaultPocoTest), fixture.ConnectionString);

            services
            .AddIdentity <IdentityUser, IdentityRole>()
            .AddLinqToDBStores(factory);

            services.AddTransient(_ => new IdentityDataConnection(_dataProvider, fixture.ConnectionString));

            services.AddLogging();

            var provider = services.BuildServiceProvider();

            _builder = new ApplicationBuilder(provider);

            factory.CreateTables <IdentityUser, IdentityRole, string>();
        }