This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/ServiceStack.Text/Common Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ private static bool Init()
134
134
int propertyOrder = - 1 ;
135
135
var propertyType = propertyInfo . PropertyType ;
136
136
var defaultValue = propertyType . GetDefaultValue ( ) ;
137
- bool propertySuppressDefaultConfig = defaultValue != null && propertyType . IsValueType ( ) && JsConfig . HasSerializeFn . Contains ( propertyType ) ;
137
+ bool propertySuppressDefaultConfig = defaultValue != null && propertyType . IsValueType ( ) && ! propertyType . IsEnum ( ) && JsConfig . HasSerializeFn . Contains ( propertyType ) ;
138
138
bool propertySuppressDefaultAttribute = false ;
139
139
140
140
var shouldSerialize = GetShouldSerializeMethod ( propertyInfo ) ;
@@ -183,7 +183,7 @@ private static bool Init()
183
183
int propertyOrder = - 1 ;
184
184
var propertyType = fieldInfo . FieldType ;
185
185
var defaultValue = propertyType . GetDefaultValue ( ) ;
186
- bool propertySuppressDefaultConfig = defaultValue != null && propertyType . IsValueType ( ) && JsConfig . HasSerializeFn . Contains ( propertyType ) ;
186
+ bool propertySuppressDefaultConfig = defaultValue != null && propertyType . IsValueType ( ) && ! propertyType . IsEnum ( ) && JsConfig . HasSerializeFn . Contains ( propertyType ) ;
187
187
bool propertySuppressDefaultAttribute = false ;
188
188
#if ( NETFX_CORE )
189
189
var shouldSerialize = ( Func < T , bool > ) null ;
You can’t perform that action at this time.
0 commit comments