<OTA_InventoryCheckRQ EchoToken=\"487ef6b0-3526-45e3-81e7-0eac31754c10\" Password=\"abc888888\" PrimaryLangID=\"en-us\" TimeStamp=\"2021-04-20 10:30:59\" UserName=\"guowang\" Version=\"1.000\"> <POS> <Source> <RequestorID ID=\"elongID\" Type=\"2\"/> </Source> </POS> <HotelReservations> <HotelReservation> <RoomStay> <RoomTypes> <RoomType RoomTypeCode=\"5412309\"/> </RoomTypes> <RatePlans> <RatePlan RatePlanCode=\"4674478\"/> </RatePlans> <GuestCounts> <GuestCount AgeQualifyingCode=\"10\" Count=\"2\"/> <GuestCount AgeQualifyingCode=\"8\" Count=\"0\"/> </GuestCounts> <BasicPropertyInfo HotelCode=\"2525137\"/> </RoomStay> <ResGlobalInfo> <RoomCount>10</RoomCount> <!-- 会员登记-开关露出 --> <MemberLevel>V1</MemberLevel> <TimeSpan End=\"2021-04-30\" Start=\"2021-04-29\"/> </ResGlobalInfo> </HotelReservation> </HotelReservations> </OTA_InventoryCheckRQ>转换为.net core模型
时间: 2024-02-06 22:02:13 浏览: 89
以下是将该XML转换为.net core模型的代码:
```
using System.Xml.Serialization;
[XmlRoot(ElementName = "OTA_InventoryCheckRQ")]
public class InventoryCheckRequest
{
[XmlAttribute(AttributeName = "EchoToken")]
public string EchoToken { get; set; }
[XmlAttribute(AttributeName = "Password")]
public string Password { get; set; }
[XmlAttribute(AttributeName = "PrimaryLangID")]
public string PrimaryLangID { get; set; }
[XmlAttribute(AttributeName = "TimeStamp")]
public string TimeStamp { get; set; }
[XmlAttribute(AttributeName = "UserName")]
public string UserName { get; set; }
[XmlAttribute(AttributeName = "Version")]
public string Version { get; set; }
public POS POS { get; set; }
public HotelReservations HotelReservations { get; set; }
}
public class POS
{
public Source Source { get; set; }
}
public class Source
{
public RequestorID RequestorID { get; set; }
}
public class RequestorID
{
[XmlAttribute(AttributeName = "ID")]
public string ID { get; set; }
[XmlAttribute(AttributeName = "Type")]
public string Type { get; set; }
}
public class HotelReservations
{
public HotelReservation HotelReservation { get; set; }
}
public class HotelReservation
{
public RoomStay RoomStay { get; set; }
public ResGlobalInfo ResGlobalInfo { get; set; }
}
public class RoomStay
{
public RoomTypes RoomTypes { get; set; }
public RatePlans RatePlans { get; set; }
public GuestCounts GuestCounts { get; set; }
public BasicPropertyInfo BasicPropertyInfo { get; set; }
}
public class RoomTypes
{
public RoomType RoomType { get; set; }
}
public class RoomType
{
[XmlAttribute(AttributeName = "RoomTypeCode")]
public string RoomTypeCode { get; set; }
}
public class RatePlans
{
public RatePlan RatePlan { get; set; }
}
public class RatePlan
{
[XmlAttribute(AttributeName = "RatePlanCode")]
public string RatePlanCode { get; set; }
}
public class GuestCounts
{
public List<GuestCount> GuestCount { get; set; }
}
public class GuestCount
{
[XmlAttribute(AttributeName = "AgeQualifyingCode")]
public string AgeQualifyingCode { get; set; }
[XmlAttribute(AttributeName = "Count")]
public string Count { get; set; }
}
public class BasicPropertyInfo
{
[XmlAttribute(AttributeName = "HotelCode")]
public string HotelCode { get; set; }
}
public class ResGlobalInfo
{
public string RoomCount { get; set; }
public string MemberLevel { get; set; }
public TimeSpan TimeSpan { get; set; }
}
public class TimeSpan
{
[XmlAttribute(AttributeName = "End")]
public string End { get; set; }
[XmlAttribute(AttributeName = "Start")]
public string Start { get; set; }
}
```
阅读全文