コード例 #1
0
 public void GetPolicies(JsonSerializerOptions options)
 {
     if (ClassType == ClassType.Enumerable)
     {
         EnumerableConverter = DefaultConverters.GetEnumerableConverter(Type, propertyInfo: null, Type, options);
     }
 }
コード例 #2
0
        public virtual void GetPolicies(JsonSerializerOptions options)
        {
            {
                PropertyNamePolicyAttribute attr = DefaultConverters.GetPolicy <PropertyNamePolicyAttribute>(ParentClassType, PropertyInfo, options);
                if (attr != null)
                {
                    NameConverter = attr;
                }
            }

            {
                _skipNullValuesOnRead  = DefaultConverters.GetPropertyClassAssemblyPolicy(ParentClassType, PropertyInfo, options, attr => attr.SkipNullValuesOnRead);
                _skipNullValuesOnWrite = DefaultConverters.GetPropertyClassAssemblyPolicy(ParentClassType, PropertyInfo, options, attr => attr.SkipNullValuesOnWrite);
            }

            if (ElementClassInfo != null)
            {
                EnumerableConverter = DefaultConverters.GetEnumerableConverter(ParentClassType, PropertyInfo, PropertyType, options);
            }
        }