Пример #1
0
        public async Task <IEnumerable <UserViewWithRoleIdsDTO> > GetAllUsers()
        {
            IEnumerable <ApplicationUser> users = await db.AuthRepository.GetAllUsers();

            IEnumerable <UserViewWithRoleIdsDTO> retVal = users.Select(x => UserToUserDTOConverters.UserToUserViewWithRoleIds(x));

            return(retVal);
        }
Пример #2
0
        public async Task <UserViewWithRoleIdsDTO> GetUserById(string id)
        {
            ApplicationUser user = await db.AuthRepository.FindUserById(id);

            if (user == null)
            {
                logger.Warn("No such user. {0}", id);
                return(null);
            }
            logger.Info("Getting user with id {0}", id);

            UserViewWithRoleIdsDTO retVal = UserToUserDTOConverters.UserToUserViewWithRoleIds(user);

            return(retVal);
        }