public async Task <IActionResult> Get() { IList <Reservation> list = await _services.GetAll(); if (list != null) { return(Ok(list)); } else { return(BadRequest()); } }
public IActionResult All() { List <Reservation> Reservations = reservationServices.GetAll().ToList(); List <EditReservationViewModel> model = Reservations.Select(n => new EditReservationViewModel { Id = n.Id, ReservedRoom = n.ReservedRoom, ClientReservations = n.ClientReservations, CheckIn = n.CheckIn, CheckOut = n.CheckOut, IncludeBreakfast = n.IncludeBreakfast, AllInclusive = n.AllInclusive }).ToList(); return(View(model)); }