Ejemplo n.º 1
0
        public static void RegisterTypes(IRegisterClient registerClient)
        {
            // register all types to be used inside of the project here
            registerClient.Register(typeof(IFileStore), typeof(FileSystemFileStore));

            // register all types to be used outside of the project here
            registerClient.Register(typeof(IStartupDal), typeof(StartupDal));
            registerClient.Register(typeof(ISearchDal), typeof(SearchDal));

            registerClient.Register(typeof(IDal <IAccountDataModel>), typeof(AccountDal));
            registerClient.Register(typeof(IAccountDal), typeof(AccountDal));
            registerClient.Register(typeof(IDal <IRightDataModel>), typeof(RightDal));
            registerClient.Register(typeof(IRightDal), typeof(RightDal));
            registerClient.Register(typeof(IDal <IRoleDataModel>), typeof(RoleDal));
            registerClient.Register(typeof(IRoleDal), typeof(RoleDal));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Register([FromBody] Client client)
        {
            if (ModelState.IsValid)
            {
                ClientResult clientResult = await _registerClient.Register(client.FirstName, client.LastName);

                return(Ok());
            }

            return(BadRequest(ModelState));
        }
Ejemplo n.º 3
0
        public static void RegisterTypes(IRegisterClient registerClient)
        {
            // register all services to be used outside of the project here
            registerClient.Register(typeof(IStartupService), typeof(StartupService));
            registerClient.Register(typeof(ISearchService), typeof(SearchService));
            registerClient.Register(typeof(IAccountService), typeof(AccountService));
            registerClient.Register(typeof(IRightService), typeof(RightService));
            registerClient.Register(typeof(IRoleService), typeof(RoleService));

            // register all state machines to be used outside of the project here
            registerClient.Register(typeof(IAccountStateMachine), typeof(AccountStateMachine));
            registerClient.Register(typeof(IRightStateMachine), typeof(RightStateMachine));
            registerClient.Register(typeof(IRoleStateMachine), typeof(RoleStateMachine));

            // register all validators only be used internally to this project
            registerClient.Register(typeof(IAccountValidator), typeof(AccountValidator));
            registerClient.Register(typeof(IAccountChangeHandler), typeof(AccountChangeHandler));
            registerClient.Register(typeof(IRightValidator), typeof(RightValidator));
            registerClient.Register(typeof(IRightChangeHandler), typeof(RightChangeHandler));
            registerClient.Register(typeof(IRoleValidator), typeof(RoleValidator));
            registerClient.Register(typeof(IRoleChangeHandler), typeof(RoleChangeHandler));

            // register other tools
            registerClient.Register(typeof(ICryptoProvider), typeof(CryptoProvider));
            registerClient.Register(typeof(ILogProvider), typeof(LogProvider));
        }