src/Dangl.Data.Shared/Json/CamelCaseDefaultValuesContractResolver.cs
/// <summary>
/// This specifies to ignore default values for DateTime, DateTimeOffset
/// and Guid
/// </summary>
/// <param name="member"></param>
/// <param name="memberSerialization"></param>
/// <returns></returns>
This specifies to ignore default values for DateTime, DateTimeOffset
and Guid
This specifies to ignore default values for DateTime DateTimeOffset and Guid
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
        {
            JsonProperty prop = base.CreateProperty(member, memberSerialization);
            if (prop.PropertyType == typeof(DateTime))
            {
                prop.DefaultValueHandling = DefaultValueHandling.Ignore;
            }
            if (prop.PropertyType == typeof(DateTimeOffset))
            {
                prop.DefaultValueHandling = DefaultValueHandling.Ignore;
            }
            if (prop.PropertyType == typeof(Guid))
            {
                prop.DefaultValueHandling = DefaultValueHandling.Ignore;
            }
            return prop;
        }
protected override JsonProperty CreateProperty ( MemberInfo member , MemberSerialization memberSerialization ) { JsonProperty prop = base . CreateProperty ( member , memberSerialization ) ; if ( prop . PropertyType == typeof ( DateTime ) ) { prop . DefaultValueHandling = DefaultValueHandling . Ignore ; } if ( prop . PropertyType == typeof ( DateTimeOffset ) ) { prop . DefaultValueHandling = DefaultValueHandling . Ignore ; } if ( prop . PropertyType == typeof ( Guid ) ) { prop . DefaultValueHandling = DefaultValueHandling . Ignore ; } return prop ; }
This specifies to ignore default values for DateTime, DateTimeOffset
and Guid
This specifies to ignore default values for DateTime DateTimeOffset and Guid
None
member
MemberInfo
None
memberSerialization
MemberSerialization
None