如何在具有保留名称的类中命名属性

时间:2013-11-04 10:52:03

标签: c# .net windows-phone-8

我有一个简单的问题,我正在反序列化Json,我需要我的类属性名称与原始JSON完全相同。我的问题是必须将其中一个属性命名为:“explicit”,这是保留的...我该如何解决这个问题?

    public Int32 page { get; set; }
    public Int32 limit { get; set; }
    public Boolean explicit {get;set;} // problem here explicit is reserved by the language

提前谢谢

2 个答案:

答案 0 :(得分:1)

这应该有效:

public Boolean @explicit {get;set;}

答案 1 :(得分:1)

相关问题