コード例 #1
0
 public void Init()
 {
     using (var uow = new DatabaseContext(Config))
     {
         uow.DropSchema();
         uow.CreateSchema();
     }
 }
コード例 #2
0
        public static void TestInit(TestContext tstContext)
        {
            Configuration = Fluently.Configure().Database(MsSqliteConfiguration.Standard.ConnectionString("Data Source=:memory:;cache=shared;mode=memory")).Mappings(
                o => o.FluentMappings
                .AddFromAssemblyOf <Banking.Models.Context.Mappings.NHib.SqlServer.BankAccountMap>()).BuildConfiguration();

            // Keep connection to in-memory db alive for duration of test
            // otherwise the db gets discarded when all connections are closed
            OpenContext = new DatabaseContext(Configuration);
            OpenContext.CreateSchema();
        }