c# - 将数据表字符串从 Azure ML WS 转换为实际的数据表 C# 对象?

标签 c# azure datatable azure-machine-learning-service

基本上,我从我的 azure ws 输出中收到这样的输出:

{
    'Results': {
        'WSOutput': {
            'type': 'table',
            'value': {
                'ColumnNames': ['ID', 'Start', 'Ask', 'Not', 'Passed', 'Suggest'],
                'ColumnTypes': ['Int32', 'Int32', 'Int32', 'Double', 'Int64', 'Int32'],
                'Values': [['13256025', '25000', '19000', '0.35', '1', '25000']]
            }
        }
    }
}

如您所见,该字符串包含创建数据表对象的信息。现在,我似乎找不到一种简单的方法将其转换为实际的数据表 POCO。我可以使用 Newtonsoft.Json.Linq 手动编写解析器,但必须有一种更简单的方法。

有人知道怎么做吗?我似乎在网上找不到任何东西。

最佳答案

是的,网上有一个开源在线生成器( http://jsonutils.com/ )。复制粘贴您的结果将为您提供:

 public class Value
    {
        public IList<string> ColumnNames { get; set; }
        public IList<string> ColumnTypes { get; set; }
        public IList<IList<string>> Values { get; set; }
    }

    public class WSOutput
    {
        public string type { get; set; }
        public Value value { get; set; }
    }

    public class Results
    {
        public WSOutput WSOutput { get; set; }
    }

    public class Example
    {
        public Results Results { get; set; }
    }

关于c# - 将数据表字符串从 Azure ML WS 转换为实际的数据表 C# 对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49056593/

相关文章:

c# - 计算两个日期之间的差异并获得以年为单位的值?

azure - 从 ADLS Gen2(blob 文件)和 CosmosDB(自定义元数据)在 Azure 认知搜索中创建单个索引

javascript - 数据表警告 : Cannot reinitialise DataTable

c# - 从 BlockingCollection 中移除项目

c# - LINQ 语句中的多个 OR 子句

email - 从 Azure 上托管的 Web 应用程序发送 Gmail

Azure IoT Explorer 不再获取设备遥测

json - 反序列化缺少第一列的数据表

java - PrimeFaces DataTable - 过滤(运行示例的问题)

c# - MS Access 存储的 DateTime.MinValue 不正确?