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)); }
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); }