c# - 如何从 C# 中的 API 创建的 IList 中检索数据
问题描述
我正在使用http://jsonutils.com/和 Postman 将数据从 API 预订系统中提取到 C# 中来帮助我创建类。
我可以从类中提取数据,但不能从 Ilist 中提取。有什么建议吗?
下面是使用 in 生成的类和 Ilist 的示例。我可以从 Session 类中提取数据,但不能从 Event 类中提取数据。
//events field
public class Session
{
public int eventID { get; set; }
public int companyID { get; set; }
public object rdPartyID { get; set; }
public int eventCatID { get; set; }
public string name { get; set; }
public string date { get; set; }
public string time { get; set; }
public string endDate { get; set; }
public string endTime { get; set; }
public object notes { get; set; }
public int capacity { get; set; }
public string status { get; set; }
public int spacesReserved { get; set; }
public int spacesSold { get; set; }
public int spacesAvailable { get; set; }
public int orderCount { get; set; }
public int reservationCount { get; set; }
public string sessionType { get; set; }
}
public class Event
{
public int eventCatID { get; set; }
public object rdPartyID { get; set; }
public string name { get; set; }
public string description { get; set; }
public string shortDescription { get; set; }
public object soldOutMessage { get; set; }
public string image { get; set; }
public string sessionType { get; set; }
public int allowSalesDuringSessions { get; set; }
public int yellowThreshold { get; set; }
public int amberThreshold { get; set; }
public int redThreshold { get; set; }
public string status { get; set; }
public int navOrder { get; set; }
public string website { get; set; }
public object terms { get; set; }
public string staffSalesCutoffPointAfterSessionStart { get; set; }
public object staffSalesCutoffTime { get; set; }
public int showSessionNames { get; set; }
public int showRemainingSpaces { get; set; }
public object capacityNotificationSpacesRemaining { get; set; }
public object capacityNotificationMessage { get; set; }
public int showAvailabilityColoursOnDay { get; set; }
public int customerEditable { get; set; }
public int amendmentCutoffHoursBeforeEvent { get; set; }
public string amendmentChargePer { get; set; }
public string amendmentCharge { get; set; }
public string amendmentChargeCap { get; set; }
public string backgroundImage { get; set; }
public IList<Session> sessions { get; set; }
}
我的基础课程的数据提取很容易提前谢谢你
解决方案
推荐阅读
- java - 如何使用Java将文本附加到一个目录中的多个文件
- java - Socket 到 Socket 通信,Server 仅充当中间人
- ruby-on-rails - 如何在activerecord中切换两个表
- javascript - 创建一个接收整数并以螺旋格式返回 NxN 二维数组的函数
- maven - Flyway maven插件设置
- javascript - 为什么需要@babel-core
- c# - 如何在没有附加类的情况下解析 json?
- node.js - 找到所需文件后,如何立即停止递归搜索目录?
- python - 如何从 Pandas 数据框中获取 1 和 0 的最大连续数量
- android - RecyclerView ItemView 在 OREO 及以上版本崩溃