Beispiel #1
0
        public HttpResponseMessage GetAllRegisterees(int id)
        {
            IEnumerable <PersonViewModel> people = new List <PersonViewModel>();

            try
            {
                people = _service.GetAllRegisterees(id).Select(a => PersonViewModel.CreateViewModel(a)).OrderBy(a => a.FirstName).ToList <PersonViewModel>();
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NoContent, "Error retrieving event"));
            }

            return(Request.CreateResponse(HttpStatusCode.OK, new { data = people }));
        }