예제 #1
0
        public IHttpActionResult GetBooking()
        {
            var booking = _bookingManager.GetBookings();

            if (booking == null)
            {
                return(Json("No record found."));
            }

            return(Ok(booking));
        }
예제 #2
0
        public IActionResult Get()
        {
            IEnumerable <Booking> bookings = bookingManager.GetBookings();

            //Generate a list of HALResponses
            var response = new List <HALResponse>();

            foreach (Booking booking in bookings)
            {
                response.Add(
                    new HALResponse(booking)
                    .AddLinks(new Link[] {
                    new Link(Link.RelForSelf, $"/api/v1/bookings/{booking.Id}")
                })
                    );
            }

            return(this.Ok(response));
        }
예제 #3
0
 public IHttpActionResult GetBookings()
 {
     return(Ok(_bookingManager.GetBookings()));
 }
 // GET: Booking
 public ActionResult Index()
 {
     return(View(_bookingManager.GetBookings(User.Identity.Name)));
 }
 public IEnumerable <BookingViewModel> GetAllBooking()
 {
     return(_bookingManager.GetBookings());
 }
예제 #6
0
        public ActionResult Bookings()
        {
            IEnumerable <BookingView> bookings = _bookingManager.GetBookings();

            return(View(bookings));
        }