public ActionResult <GetCategoryBookingResponse> GetBookingById(Guid id) { var booking = context.Bookings.Find(id); context.Entry(booking).Reference(b => b.Category).Load(); if (booking == null) { return(NotFound()); } GetCategoryBookingResponse response = mapper.Map <GetCategoryBookingResponse>(booking); response.Category = mapper.Map <GetMinCategoryResponse>(booking.Category); return(Ok(response)); }