private static string MakeMessage(MovieReservation reservation) { if (reservation.ProviderName == "Netflix") { return string.Format("{0} on {1} was added to your Netflix Queue", reservation.Title, reservation.Format); } return string.Format("{0} on {1} is waiting for you at Redbox", reservation.Title, reservation.Format); }
// POST /api/reservations public HttpResponseMessage<MovieReservationResult> PostReservation(MovieReservation reservation) { return new HttpResponseMessage<MovieReservationResult>(new MovieReservationResult { ConfirmationMessage = MakeMessage(reservation) }, HttpStatusCode.OK); }