コード例 #1
0
        public void BasicConfigurationApi()
        {
            IActiveRecordConfiguration configuration = AR.Configure()
                                                       .Flush(DefaultFlushType.Leave)
                                                       .UseThreadScopeInfo <SampleThreadScopeInfo>()
                                                       .UseSessionFactoryHolder <SampleSessionFactoryHolder>();

            Assert.That(configuration.ThreadScopeInfoImplementation, Is.EqualTo(typeof(SampleThreadScopeInfo)));
            Assert.That(configuration.SessionFactoryHolderImplementation, Is.EqualTo(typeof(SampleSessionFactoryHolder)));
            Assert.That(configuration.DefaultFlushType, Is.EqualTo(DefaultFlushType.Leave));
        }
コード例 #2
0
        public override IActiveRecordConfiguration GetConfigSource()
        {
            var source = AR.Configure()
                         .CreateConfiguration(c => c
                                              .AddAssemblies(GetAssemblies())
                                              .SetDatabaseType(DatabaseType.SQLite)
                                              .ConnectionString("Data Source=:memory:;Version=3;New=True")
                                              .ConnectionProvider <InMemoryConnectionProvider>()
                                              .Set(GetProperties())
                                              );


            return(source);
        }