Пример #1
0
        public UserAppModel GetUser(int id)
        {
            IReadOnlyRepository <DtoUser> readOnlyRepository = repositoryFactory.CreateReadOnlyUsersRepository();
            DtoUser user = readOnlyRepository.Get(id);
            AbstractMapper <DtoUser, UserAppModel> mapper = mapperFactory.Create <DtoUser, UserAppModel>();

            return(mapper.Map(user));
        }
Пример #2
0
        public IList <UserAppModel> GetUsers(SearchRule[] search_rules, OrderingRule[] ordering_rules)
        {
            IReadOnlyRepository <DtoUser>          readOnlyRepository = repositoryFactory.CreateReadOnlyUsersRepository();
            IEnumerable <DtoUser>                  users  = readOnlyRepository.Get(search_rules, ordering_rules);
            AbstractMapper <DtoUser, UserAppModel> mapper = mapperFactory.Create <DtoUser, UserAppModel>();

            return(mapper.Map(users));
        }
Пример #3
0
        public IList <UserAppModel> GetAllUsers()
        {
            IReadOnlyRepository <DtoUser>          readOnlyRepository = repositoryFactory.CreateReadOnlyUsersRepository();
            IEnumerable <DtoUser>                  users  = readOnlyRepository.GetAll();
            AbstractMapper <DtoUser, UserAppModel> mapper = mapperFactory.Create <DtoUser, UserAppModel>();

            return(mapper.Map(users));
        }
Пример #4
0
        public UserAppModel DecryptToken(string UUID, string tokenString)
        {
            SessionToken sessionToken = tokenGenerator.Decrypt(tokenString);

            if (sessionToken.IsValid(UUID))
            {
                AbstractMapper <SessionToken, UserAppModel> mapper = mapperFactory.Create <SessionToken, UserAppModel>();
                return(mapper.Map(sessionToken));
            }
            ;

            return(null);
        }
Пример #5
0
 public CharacterDto GetCharacterById(int characterId)
 {
     return(_characterMapper.Map(_getCharacterByIdUseCase.ExecuteWith(characterId)));
 }