Exemplo n.º 1
0
        public static void Initialize()
        {
            SqlDbmsType   dbType                = SqlDbmsType.SqlServer;
            var           configuration         = Container.Resolve <IWebConfiguration>();
            List <string> connectionStringNames = configuration.GetConnectionStringNames().ToList();

            ConnectionRegister.Register(connectionStringNames, dbType);
            OrmRegister.Register(connectionStringNames, OrmType.Dapper, dbType);
            DbRegister.Register(connectionStringNames, dbType);
            Container.Register <IDataProvider, DataProvider>(ObjectLifeSpans.Singleton);
            DataRegister.Initialize();
            EntityMap.Initialize();
        }
Exemplo n.º 2
0
        private static void CustomDataAccessLayerInitialize()
        {
            var           configuration         = Container.Resolve <IWebConfiguration>();
            List <string> connectionStringNames = configuration.GetConnectionStringNames().ToList();

            ConnectionRegister.Register(connectionStringNames, SqlDbmsType.SqlServer);
            OrmRegister.Register(connectionStringNames, OrmType.Dapper, SqlDbmsType.SqlServer);
            DbRegister.Register(connectionStringNames, SqlDbmsType.SqlServer);
            Container.Register <IDataProvider, DataProvider>(ObjectLifeSpans.Singleton);
            DataRegister.Initialize();
            //EntityMap.Initialize();
            Container.Register <IUserService <IdentityUser>, UserService <IdentityUser> >();
            Container.Register <IRoleService, RoleService>();
            Container.Register <IUserClaimsService, UserClaimsService>();
            Container.Register <IUserLoginsService, UserLoginsService>();
            Container.Register <IUserRolesService, UserRolesService>();
            Container.Register <IUserStore <IdentityUser>, UserStore <IdentityUser> >();
        }