This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ internal static void Reset()
118118 var isDataContract = typeof ( T ) . IsDto ( ) ;
119119 foreach ( var propertyInfo in TypeConfig < T > . Properties )
120120 {
121- if ( ! propertyInfo . CanWrite || propertyInfo . GetSetMethod ( ) == null ) continue ;
121+ if ( ! propertyInfo . CanWrite || propertyInfo . SetMethod ( ) == null ) continue ;
122122 if ( ! TypeSerializer . CanCreateFromString ( propertyInfo . PropertyType ) ) continue ;
123123
124124 var propertyName = propertyInfo . Name ;
Original file line number Diff line number Diff line change @@ -498,7 +498,7 @@ public static T ConvertFrom(object results)
498498 return ( T ) results ;
499499 }
500500
501- foreach ( var ci in typeof ( T ) . GetConstructors ( ) )
501+ foreach ( var ci in typeof ( T ) . GetAllConstructors ( ) )
502502 {
503503 var ciParams = ci . GetParameters ( ) ;
504504 if ( ciParams . Length == 1 )
Original file line number Diff line number Diff line change @@ -892,6 +892,15 @@ public static ConstructorInfo GetEmptyConstructor(this Type type)
892892#endif
893893 }
894894
895+ public static ConstructorInfo [ ] GetAllConstructors ( this Type type )
896+ {
897+ #if ( NETFX_CORE || PCL )
898+ return type . GetTypeInfo ( ) . DeclaredConstructors ;
899+ #else
900+ return type . GetConstructors ( ) ;
901+ #endif
902+ }
903+
895904 internal static PropertyInfo [ ] GetTypesPublicProperties ( this Type subType )
896905 {
897906#if ( NETFX_CORE || PCL )
You can’t perform that action at this time.
0 commit comments