【问题标题】:How do I ignore properties when using RestSharp serialization使用 RestSharp 序列化时如何忽略属性
【发布时间】:2013-11-26 19:40:17
【问题描述】:

我一直在寻找这样的东西:

...
public string FirstName { get; set; }
public string LastName { get; set; }

[Ignore]
public string FullName { get { return FirstName + " " + LastName; } }
...

但是,似乎无法挖掘任何东西。

环境:Xamarin Studio、C#、在 Mac 上运行的 Android 项目

【问题讨论】:

    标签: c# rest attributes xamarin restsharp


    【解决方案1】:

    这取决于您使用的序列化程序:

    当您使用XmlSerializer 时,我无法确定应该使用什么属性,但我怀疑它应该是[NonSerialized][ScriptIgnore][XmlIgnore]

    文档:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-07
      • 1970-01-01
      • 1970-01-01
      • 2010-12-20
      • 1970-01-01
      • 1970-01-01
      • 2014-07-31
      • 1970-01-01
      相关资源
      最近更新 更多