application/x-www-form-urlencoded传参,<OTA_CancelRQ EchoToken="012491f4-f2cc-4842-b5bd-8eb112e5bead" UserName="Elong" Password="Elong" PrimaryLangID="en-us" TimeStamp="2012-05-27 22:21:21" Version="1.000" ><POS><Source><RequestorID ID="elong" Type="2"/></Source></POS><CancelOutOfRule Rule="true"><PayHotelAmount>0.0000</PayHotelAmount><clientUniqueId>17050039</clientUniqueId><deductHotelAmount>166.7800</deductHotelAmount><Notes>客人行程有变申请免费取消</Notes></CancelOutOfRule><UniqueID ID="705545245" Type="14"><CompanyName>Elong</CompanyName></UniqueID><UniqueID ID="942033314699" Type="10"><CompanyName>PartnerID</CompanyName></UniqueID><Reasons><Reason>客人申请免费取消</Reason></Reasons></OTA_CancelRQ>转化为.net core模型
时间: 2023-07-19 14:42:10 浏览: 111
可以使用以下的.NET Core模型来表示上述的application/x-www-form-urlencoded传参:
```csharp
public class OTA_CancelRQ
{
public string EchoToken { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public string PrimaryLangID { get; set; }
public string TimeStamp { get; set; }
public string Version { get; set; }
public POS POS { get; set; }
public CancelOutOfRule CancelOutOfRule { get; set; }
public List<UniqueID> UniqueID { get; set; }
public Reasons Reasons { get; set; }
}
public class POS
{
public Source Source { get; set; }
}
public class Source
{
public RequestorID RequestorID { get; set; }
}
public class RequestorID
{
public string ID { get; set; }
public string Type { get; set; }
}
public class CancelOutOfRule
{
public string Rule { get; set; }
public string PayHotelAmount { get; set; }
public string clientUniqueId { get; set; }
public string deductHotelAmount { get; set; }
public string Notes { get; set; }
}
public class UniqueID
{
public string ID { get; set; }
public string Type { get; set; }
public string CompanyName { get; set; }
}
public class Reasons
{
public string Reason { get; set; }
}
```
然后使用.NET Core中的相关工具来将application/x-www-form-urlencoded传参转换为OTA_CancelRQ对象即可。具体转换方式可以参考相关的.NET Core文档。
阅读全文