コード例 #1
0
        public ReservationModel Get(int reservationId, int clientId = 0)
        {
            var rsv = DA.Current.Single <Reservation>(reservationId);

            if (rsv != null)
            {
                int cid = (clientId == 0) ? rsv.Client.ClientID : clientId;
                return(_manager.CreateReservationModel(rsv, cid, Request.GetOwinContext().Request.RemoteIpAddress));
            }
            else
            {
                throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Reservation does not exist."));
            }
        }