Esempio n. 1
0
        public void BasicTearDown()
        {
            this.Context.Rollback();
            this.Context.Dispose();

            this.DropDatabase();

            RegisterDaos.UnRegisterAll(typeof(SqlCeDialect), typeof(SqlCeDialectVersion));
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
        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();
        }
Esempio n. 5
0
        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();
        }
Esempio n. 6
0
        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();
        }