Esempio n. 1
0
        /// <summary>
        /// Возвращает данные пользователя
        /// </summary>
        /// <param name="credentials">пользовательские полномочия</param>
        /// <returns></returns>
        public PersonDto GetPersonData(PersonCredentials credentials)
        {
            var person = _personDao.GetByNameAndRoleType(credentials.Nickname, credentials.Role);

            if (person == null)
            {
                return(null);
            }

            var checkedPass = PasswordHelper.CheckPasswordHash(credentials.Password, person.Password);

            if (checkedPass)
            {
                var personData = Mapper.Map <PersonDto>(person);
                return(personData);
            }
            return(null);
        }