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)); }
public async Task <IActionResult> OnGetAsync() { Guests = await _guestService.GetAllGuests(); return(Page()); }