/// 当值匹配时需要忽略的属性
/// </summary>
public class IgnoreValueAttribute : Attribute
{
public IgnoreValueAttribute(object value)
{
this.Value = value;
}
public object Value { get; set; }
}
/// <summary>
/// 例外属性,即不排除的属性值
/// </summary>
public class ExcludedAttribute : Attribute
{
}
/// <summary>
/// 枚举类型显示字符串
/// </summary>
public class EnumStringAttribute : Attribute
{
}
}
B、WeixinJsonConventer修改:
public override IDictionary<string, object> Serialize(object obj, JavaScriptSerializer serializer)
{
var result = new Dictionary<string, object>();
if (obj == null)
{
return result;
}
1、增加特性,对json格式的输出内容的控制,对枚举类型字符串输出、默认值不输出、例外属性等,如会员卡卡里面的CodeType,主要修改如下: A、 namespace Senparc.Weixin { ///
}
B、WeixinJsonConventer修改:
public override IDictionary<string, object> Serialize(object obj, JavaScriptSerializer serializer) { var result = new Dictionary<string, object>(); if (obj == null) { return result; }
2、会员卡:
A、Card_MemberCardUpdateData 相关属性修改
///