Exemple #1
0
        public HttpResponseMessage Get(HttpRequestMessage request)
        {
            var data = service.GetAllGuests();

            if (data != null)
            {
                var guests = mapper.Map <IEnumerable <GuestDTO>, List <GuestModel> >(data);
                return(request.CreateResponse(HttpStatusCode.OK, guests));
            }

            return(request.CreateResponse(HttpStatusCode.NotFound));
        }
Exemple #2
0
        public async Task <IActionResult> OnGetAsync()
        {
            Guests = await _guestService.GetAllGuests();

            return(Page());
        }