@@ -83,18 +83,19 @@ private void Map(object target, IDictionary<string, object> data)
83
83
{
84
84
name = prop . Name ;
85
85
}
86
-
87
- var parts = name . Split ( '.' ) ;
88
- var currentData = data ;
89
- object value = null ;
90
- for ( var i = 0 ; i < parts . Length ; ++ i )
91
- {
92
- var actualName = parts [ i ] . GetNameVariants ( Culture ) . FirstOrDefault ( currentData . ContainsKey ) ;
93
- if ( actualName == null ) break ;
94
- if ( i == parts . Length - 1 ) value = currentData [ actualName ] ;
95
- else currentData = ( IDictionary < string , object > ) currentData [ actualName ] ;
96
- }
97
- if ( value != null ) prop . SetValue ( target , ConvertValue ( type , value ) , null ) ;
86
+
87
+ var parts = name . Split ( '.' ) ;
88
+ var currentData = data ;
89
+ object value = null ;
90
+ for ( var i = 0 ; i < parts . Length ; ++ i )
91
+ {
92
+ var actualName = parts [ i ] . GetNameVariants ( Culture ) . FirstOrDefault ( currentData . ContainsKey ) ;
93
+ if ( actualName == null ) break ;
94
+ if ( i == parts . Length - 1 ) value = currentData [ actualName ] ;
95
+ else currentData = ( IDictionary < string , object > ) currentData [ actualName ] ;
96
+ }
97
+
98
+ if ( value != null ) prop . SetValue ( target , ConvertValue ( type , value ) , null ) ;
98
99
}
99
100
}
100
101
@@ -106,17 +107,16 @@ private IDictionary BuildDictionary(Type type, object parent)
106
107
{
107
108
var key = child . Key ;
108
109
object item = null ;
109
- if ( valueType . IsGenericType && valueType . GetGenericTypeDefinition ( ) == typeof ( List < > ) )
110
+ if ( valueType . IsGenericType && valueType . GetGenericTypeDefinition ( ) == typeof ( List < > ) )
110
111
{
111
- item = BuildList ( valueType , child . Value ) ;
112
+ item = BuildList ( valueType , child . Value ) ;
112
113
}
113
114
else
114
115
{
115
- item = ConvertValue ( valueType , child . Value ) ;
116
+ item = ConvertValue ( valueType , child . Value ) ;
116
117
}
117
118
dict . Add ( key , item ) ;
118
119
}
119
-
120
120
return dict ;
121
121
}
122
122
0 commit comments