【发布时间】:2020-11-06 00:07:19
【问题描述】:
<root>
<source>
<fields>
<string propertyName="Status" class="System.String" nullable="true" valueInputType="all" displayName="status" description="Condition" maxLength="150" />
<function methodName="Calculator" displayName="Calculator" includeInCalculations="true">
<parameters>
<input valueInputType="all" class="System.String" type="string" nullable="true" maxLength="256" />
</parameters>
<returns valueInputType="all" class="System.Double" type="numeric" nullable="false" min="-9007199254740992" max="9007199254740992" allowDecimal="true" allowCalculation="true" />
</function>
</fields>
</source>
</root>
我必须生成一个类似于此 XML 的对象,如下所示:
[Field(DisplayName = "Status", Max = 150, Description = "Condition")]
public string Status;
[Method(DisplayName = "Calculator")]
public double Calculator(string st)
{
double num = st.length();
return num;
}
即使我收到 Object 的类型没问题,我什至可能都不会直接使用该对象。
【问题讨论】:
标签: c# xml xml-parsing dynamicobject