Esempio n. 1
0
        public IHttpActionResult GetUser(int id)
        {
            User u = null;

            using (DAL.UserRepository repo = new DAL.UserRepository(_con)) { u = UserConverter.ConvertTo(repo.GetById(id)); }

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

            return(Ok(u));
        }
        public async Task <IEnumerable <UserResponse> > GetAdminUsers()
        {
            var users = await UserRepository.GetEntityListAsync();

            return(users.Select(x => UserConverter.ConvertTo(x)));
        }
Esempio n. 3
0
        public IEnumerable <User> GetAllUsers()
        {
            User[] toReturn;

            using (DAL.UserRepository repo = new DAL.UserRepository(_con)) { toReturn = UserConverter.ConvertTo(repo.GetAll()); }

            return(toReturn);
        }