private static Entity PrepareBookingExtraService(Booking bookinginfo, ExtraService extraService, Guid bookingId, ITracingService trace) { trace.Trace("Preparing Booking Transfer information - Start"); var extraServiceEntity = new Entity(EntityName.BookingExtraService); if (!string.IsNullOrWhiteSpace(extraService.ExtraServiceCode)) { extraServiceEntity[Attributes.BookingExtraService.ExtraServiceCode] = extraService.ExtraServiceCode; } SetNameFor(extraService, bookinginfo, extraServiceEntity); extraServiceEntity[Attributes.BookingExtraService.Order] = extraService.Order; if (!string.IsNullOrWhiteSpace(extraService.StartDate)) { extraServiceEntity[Attributes.BookingExtraService.StartDateAndTime] = DateTime.Parse(extraService.StartDate); } if (!string.IsNullOrWhiteSpace(extraService.EndDate)) { extraServiceEntity[Attributes.BookingExtraService.EndDateTime] = DateTime.Parse(extraService.EndDate); } extraServiceEntity[Attributes.BookingExtraService.Participants] = BookingHelper.PrepareTravelParticipantsInfoForChildRecords(bookinginfo.TravelParticipant, trace, extraService.TravelParticipantAssignment); extraServiceEntity[Attributes.BookingExtraService.BookingId] = new EntityReference(EntityName.Booking, bookingId); extraServiceEntity[Attributes.Booking.Remarks] = RemarksHelper.GetRemarksTextFromPayload(extraService.Remark); extraServiceEntity[Attributes.BookingExtraService.ExtraServiceType] = CommonXrm.GetExtraServiceType(extraService.ExtraServiceType); extraServiceEntity[Attributes.BookingExtraService.ExtraServiceDescription] = (!string.IsNullOrWhiteSpace(extraService.ExtraServiceDescription)) ? extraService.ExtraServiceDescription : string.Empty; trace.Trace("Preparing Booking Transfer information - End"); return(extraServiceEntity); }