【发布时间】:2018-07-20 20:44:44
【问题描述】:
所以我有一些 json 响应内容表示为字符串,我想获取它的属性名称。
我在做什么
let properties = Newtonsoft.Json.Linq.JObject.Parse(responseContent).Properties()
let propertyNames, (jprop: JProperty) = properties.Select(jprop => jprop.Name);
根据this的回答,我需要注释对扩展方法的调用,但是,我仍然得到错误。
无法根据此程序点之前的类型信息确定方法“Select”的唯一重载。可能需要类型注释。候选人:(扩展)Collections.Generic.IEnumerable.Select(选择器:Func):Collections.Generic.IEnumerable,(扩展)Collections.Generic.IEnumerable .Select(selector: Func) : Collections.Generic.IEnumerable
我做错了吗?
【问题讨论】: