public ActionResult <IEnumerable <UserViewModel> > GetAffiliateUsers(int affiliateId)
        {
            if (!_affiliateService.Exist(affiliateId))
            {
                return(NotFound());
            }

            return(_userService.GetAffiliateUsers(affiliateId).Select(x => UserMapper.DTOtoUserViewModel(x)).ToArray());
        }
        public ActionResult <UserViewModel> GetCurrentUser()
        {
            var userDTO = _userService.GetCurrent();

            if (userDTO == null)
            {
                return(NotFound());
            }

            return(UserMapper.DTOtoUserViewModel(userDTO));
        }
        public ActionResult <UserViewModel> GetUserByEmail(string email)
        {
            var user = _userService.GetByUsername(email);

            if (user == null)
            {
                return(NotFound());
            }

            return(UserMapper.DTOtoUserViewModel(user));
        }
        public ActionResult <UserViewModel> GetUser(string id)
        {
            var user = _userService.Get(id);

            if (user == null)
            {
                return(NotFound());
            }

            return(UserMapper.DTOtoUserViewModel(user));
        }
 public ActionResult <IEnumerable <UserViewModel> > GetUsers()
 {
     return(_userService.GetAll().Select(x => UserMapper.DTOtoUserViewModel(x)).ToArray());
 }