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()
134134 int propertyOrder = - 1 ;
135135 var propertyType = propertyInfo . PropertyType ;
136136 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 ) ;
138138 bool propertySuppressDefaultAttribute = false ;
139139
140140 var shouldSerialize = GetShouldSerializeMethod ( propertyInfo ) ;
@@ -183,7 +183,7 @@ private static bool Init()
183183 int propertyOrder = - 1 ;
184184 var propertyType = fieldInfo . FieldType ;
185185 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 ) ;
187187 bool propertySuppressDefaultAttribute = false ;
188188#if ( NETFX_CORE )
189189 var shouldSerialize = ( Func < T , bool > ) null ;
You can’t perform that action at this time.
0 commit comments