protected override void OnStartup() { var sb = new SqlConnectionStringBuilder(); sb.DataSource = "(local)"; sb.IntegratedSecurity = true; sb.InitialCatalog = "Manager.OAuth"; DbFactory.Register("OAuth", new MsSqlDbProvider(10, sb.ConnectionString)); EntitySchemaManager.LoadAssemblys(new Assembly[] { typeof(App).Assembly }); foreach (var dbProvider in DbFactory.DbProviders) { EntityUtils.CheckCreateDatabase(dbProvider.ConnectionString); } foreach (var view in EntitySchemaManager.Schemas) { EntityUtils.CheckSchema(view); RowAdapter.LoadPrimary(view); } }