public void BasicTearDown() { this.Context.Rollback(); this.Context.Dispose(); this.DropDatabase(); RegisterDaos.UnRegisterAll(typeof(SqlCeDialect), typeof(SqlCeDialectVersion)); }
public void BasicSetUp() { string baseDirectory = AppDomain.CurrentDomain.BaseDirectory; DaoFactory.Instance.ConnectionStringBuilder = new SqlCeConnectionStringBuilder("Deli.Entities", baseDirectory, null); RegisterDaos.RegisterAll(typeof(SqlCeDialect), typeof(SqlCeDialectVersion)); this.CreateDatabase(); this.Dao = DaoFactory.Instance.GetDao <TDao>(); this.Context = DaoFactory.Instance.GetContext(typeof(TDao), true); }
public Startup(IConfiguration configuration) { this.Configuration = configuration; string connectionString = this.Configuration.GetConnectionString("TestPrimitive"); DaoFactory.Instance.ConnectionStringBuilder = new ConnectionStringBuilder(connectionString, typeof(SqliteContext)) { SqlDialectType = typeof(SQLiteDialect), SqlDialectVersionType = typeof(SQLiteDialectVersion) }; RegisterDaos.RegisterAll(DaoFactory.Instance.ConnectionStringBuilder.SqlDialectType, DaoFactory.Instance.ConnectionStringBuilder.SqlDialectVersionType); RegisterServices.RegisterAll(); //this.RegisterView(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); string connectionString = ConfigurationManager.ConnectionStrings["Test1225"].ConnectionString; DaoFactory.Instance.ConnectionStringBuilder = new ConnectionStringBuilder(connectionString, typeof(SqlContext)) { SqlDialectType = typeof(SqlServerDialect), SqlDialectVersionType = typeof(SqlServerDialectVersion) }; RegisterDaos.RegisterAll(DaoFactory.Instance.ConnectionStringBuilder.SqlDialectType, DaoFactory.Instance.ConnectionStringBuilder.SqlDialectVersionType); RegisterServices.RegisterAll(); //var format = GlobalConfiguration.Configuration.Formatters; //format.XmlFormatter.SupportedMediaTypes.Clear(); }
public Startup(IConfiguration configuration) { this.Configuration = configuration; string connectionString = this.Configuration.GetConnectionString("Products"); DaoFactory.Instance.ConnectionStringBuilder = new ConnectionStringBuilder(connectionString, typeof(SqlContext)) { SqlDialectType = typeof(SqlServerDialect), SqlDialectVersionType = typeof(SqlServerDialectVersion) }; RegisterDaos.RegisterAll(DaoFactory.Instance.ConnectionStringBuilder.SqlDialectType, DaoFactory.Instance.ConnectionStringBuilder.SqlDialectVersionType); RegisterServices.RegisterAll(); /*add customized code between this region*/ /*add customized code between this region*/ //this.RegisterView(); }
protected void Application_Start() { Assembly.GetExecutingAssembly().GetTypes().Where(t => t.IsSubclassOf(typeof(AreaRegistration))).OrderByDescending(r => GetAreaLevelNumber(r.FullName)).ToList().ForEach(r => RegisterArea(r, RouteTable.Routes, null)); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); string connectionString = ConfigurationManager.ConnectionStrings["Deli"].ConnectionString; DaoFactory.Instance.ConnectionStringBuilder = new ConnectionStringBuilder(connectionString, typeof(SqlContext)) { SqlDialectType = typeof(SqlServerDialect), SqlDialectVersionType = typeof(SqlServerDialectVersion) }; RegisterDaos.RegisterAll(DaoFactory.Instance.ConnectionStringBuilder.SqlDialectType, DaoFactory.Instance.ConnectionStringBuilder.SqlDialectVersionType); RegisterServices.RegisterAll();/*add customized code between this region*/ /*add customized code between this region*/ this.RegisterView(); }