Ejemplo 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();
        }
Ejemplo n.º 2
0
        //-------------------------------------------------------------------------------------------------- Register Method

        public async Task Register(string name, string email, string password)
        {
            //new users has "new user" as default connnection string
            string cid = "New User";
            //create temp connection to send confirm msg.
            string tempCid = Context.ConnectionId;

            DbRegister register = new DbRegister();
            //Register user to db
            bool IsRegistered = await register.RegisterUser(name, email, password, cid);

            await Clients.Client(tempCid).SendAsync("ReceieveRegisterMsg", IsRegistered);

            ;
        }
Ejemplo n.º 3
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> >();
        }