我有以下代码:
///<summary>
///In this case you can set any other valid attribute for the editable element.
///For example, if the element is edittype:'text', we can set size, maxlength,
///etc. attributes. Refer to the valid attributes for the element
///</summary>
public object OtherOptions { get; set; }
public override string ToString()
{
return this.ToJSON();
}
我需要从 OtherOptions 属性中获取匿名对象,并像从主对象中一样序列化匿名对象的每个属性。
例如:
OtherOptions = new { A = "1", B = "2" }
如果我序列化它,它将是(或类似的东西):
OtherOptions: {
A: "1",
B: "2"
}
是否可以在没有显式删除的情况下将 A 和 B 置于 OtherOptions 的同一级别。