带有属性的服务端类:
[DataContract]
[Serializable]
public class BusMessage
{
[JsonProperty(PropertyName = "report")]
[DataMember(Name = "report")]
public Boolean DeliveryReportRequest
{
get { return _deliveryReportRequest; }
set { _deliveryReportRequest = value; }
}
}
使用visual studio生成的BusMessage类中的客户端属性
[System.Runtime.Serialization.DataMemberAttribute()]
public bool report {
get {
return this.reportField;
}
set {
if ((this.reportField.Equals(value) != true)) {
this.reportField = value;
this.RaisePropertyChanged("report");
}
}
}
从客户端我希望具有相同的DataMember属性,其属性名称为" report"和类属性命名为DeliveryReportRequest。如何实现呢?