Commit c6c0b75
authored
Flatten to dynamic (#40)
* Support for flattening single-member nested complex types to an untyped dictionary
* Support for mapping from non-generic IDictionary<,> implementations, e.g. ExpandoObject
* Test coverage for conversion of dynamic object simple-type member values during mapping
* Organising source Dictionary mapping tests
* Removing need to cast IDictionary<,> source objects when accessing keys
* Test coverage for mapping a null string dynamic member
* Support for mapping untyped dictionary complex type entries to complex type members / Organising source dictionary tests / Test coverage for mapping from a dynamic to nested members
* Renaming dictionary key matchers for clarity / Using efficient string.FirstOrDefault() extension method instead of string.Left(numberOfCharacters) when converting strings to character
* Supporting mapping from dynamic members with flattened names to nested target members
* Supporting flattened source Dictionary keys by default, without configuration
* Test coverage for mapping from a dynamic to a simple type enumerable member
* Support for mapping dynamic non-identifiable complex type collection members to enumerable collection members / Removing double .Map() call from Dictionary entry -> complex type enumerable mapping / Adding Type.IsClosedTypeOf extension method
* Support for mapping from dynamic, underscored-index enumerable element members to complex type enumerable members
* Organising Dictionary classes
* Test coverage for mapping from flattened dynamic members to nested complex type enumerable members
* Test coverage for mapping from dynamics to new root enumerables
* Short-circuiting mappings from dictionaries to recursive members / Including dictionary implementation type name in MappingExceptions instead of interface name / Support for id-aware mapping from:
- IDictionary<,>-implementation identifiable complex type collection entries
...over + onto:
- Identifiable complex type collections
* Test coverage for mapping from a dynamic null complex type collection member over a complex type collection member
* Support for mapping from object-valued IDictionary<,> IDictionary<,> entries to nested complex type members
* Test coverage for namming ExpandoObject (not IDictionary<,>) in thrown MappingExceptions
* Support for mapping from nested dynamic members to nested complex type members / Using constants for root source and target member names
* Extending test coverage for mapping from nested dynamics to nested complex types
* Support for mapping to ValueType-valued IDictionary<,>s / Using Shouldy ShouldContainKey() and ShouldNotContainKey()
* Support for IDictionary<,> -> complex type enumerable mapping short-circuits for target Collection<>s / Test coverage updates / Removing unused code
* Test coverage for mapping over root complex type members
* Extending enum -> enum mapping test coverage
* Start of mapping to dynamic test coverage
* Extending map-to-dynamic test coverage
* Start of test coverage for mapping over dynamics / Skipping 'assign to itself' target variable populations
* Extending coverage for mapping over dynamic root members
* Start of merging to dynamics support
* Restricting WhenMapping.DictionariesWithValueType<TValue> mappings to dictionaries of that value type / Applying WhenMapping.Dictionaries to all dictionaries of all value types / Applying source dictionary configuration to dictionaries, not ExpandoObjects
* Extending member matching test coverage
* Selecting flattened source members from parent contexts to map to nested dynamics (and dictionaries)
* Support for mapping flattened members from parent contexts to nested dynamics (and dictionaries)
* Fixing broken tests / Moving internal extension methods into dedicated namespace
* Extending test coverage for mapping to nested dynamic members
* Test coverage for mapping to root enumerable<dynamic>
* Test coverage for mapping derived complex type collection elements to dynamics
* Separating global dictionary configuration from source dictionary configuration
* Support for mapping nested members to flattened, underscore-separated target dynamic members
* Support for mapping over nested ExpandoObject members
* Beginning of dynamic configuration API / Ensuring dynamic configuration isn't applied to dictionaries
* Support for configuring creation-mapping-specific custom dynamic source members
* Test coverage for mapping onto a nested dynamic from a nested Dictionary
* Support for mapping from complex type enumerables onto nested target dynamics / Fixing infinite loop when mapping from a derived type in a collection to a dynamic (or dictionary)
* Support for configuring custom member names for source dynamic mappings
* Support for mapping from dynamics with configured member name parts / Properly handling flattened member names in StringExtensions.KeyMatches overloads
* Support for using custom member name separators for source dynamics / Tidying JoiningNameFactory / Tidying documentation
* Erroring if redundant element key patterns are configured / Organising dictionary configuration classes
* Test coverage for configuration error when configuring a redundant element key pattern for source dynamic mapping
* Erroring is redundant member name separator globally configured for dynamics
* Differentiating between global and source-only dictionary (and dynamic) configuration
* Differentiating between source-only and global dynamic configuration
* Support for differentiating global and source-specific dynamic member name separators
* Fixing dynamic mapping separator selection
* Support for mapping from a collection of structs to a target dynamic or dictionary
* Test coverage for mapping over a dynamic from an unmappable struct type collection
* Start of dynamic over enumerable mapping
* Extending dynamic over enumerables test coverage
* Separating dictionary and dynamic configurator classes / Derived dynamic configurator from FullMappingConfigurator with source type as IDictionary<string, object>
* Test coverage for mapping from dynamics to derived types based on the presence of particular dynamic members
* Start of target dynamic mapping configuration tests / Support for Mapper.Map(source).ToANew<dynamic>(), defaulting the target to ExpandoObject
* Adding target dynamic configuration API classes / Start of target dynamic configuration tests
* Support for custom, source-type-specific dynamic enumerable element patterns
* Support for conditional custom mapping to custom ExpandoObject target members
* Test coverage for various conditional mappings to custom dynamic target members
* Ensuring target dictionary configuration is not applied to target dynamics
* Test coverage ensuring target dynamic config isn't applied to target dictionaries
* Test coverage for non-conflict of target dictionary and dynamic configuration
* Flattening objects using ToANew<dynamic>()
* Tidying
* Fixing flattening test
* Handling null entries in complex type collections being flattened or mapped to dictionaries or dynamics1 parent 5cc4e77 commit c6c0b75
File tree
228 files changed
+5459
-2060
lines changed- AgileMapper.UnitTests
- Configuration
- Dictionaries
- Configuration
- Dynamics
- Configuration
- Extensions
- Members
- Reflection
- SimpleTypeConversion
- Structs/Configuration
- AgileMapper
- Api/Configuration
- Dictionaries
- Dynamics
- Configuration
- Dictionaries
- Inline
- DataSources
- Extensions
- Internal
- Flattening
- Members
- Dictionaries
- Population
- ObjectPopulation
- ComplexTypes
- Enumerables
- Dictionaries
- TypeConversion
- Validation
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
228 files changed
+5459
-2060
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
101 | 123 | | |
102 | 124 | | |
103 | 125 | | |
| |||
180 | 202 | | |
181 | 203 | | |
182 | 204 | | |
183 | | - | |
| 205 | + | |
184 | 206 | | |
185 | 207 | | |
186 | 208 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
331 | 332 | | |
332 | 333 | | |
333 | 334 | | |
334 | | - | |
335 | | - | |
| 335 | + | |
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| |||
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | | - | |
| 212 | + | |
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
| |||
Lines changed: 50 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
171 | | - | |
| 169 | + | |
| 170 | + | |
172 | 171 | | |
173 | 172 | | |
174 | 173 | | |
| 174 | + | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | | - | |
189 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | | - | |
208 | | - | |
| 206 | + | |
| 207 | + | |
209 | 208 | | |
210 | 209 | | |
211 | 210 | | |
212 | | - | |
213 | | - | |
| 211 | + | |
| 212 | + | |
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
217 | | - | |
| 216 | + | |
218 | 217 | | |
219 | 218 | | |
220 | 219 | | |
221 | 220 | | |
222 | 221 | | |
223 | 222 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
228 | 227 | | |
229 | 228 | | |
230 | 229 | | |
231 | | - | |
232 | | - | |
| 230 | + | |
| 231 | + | |
233 | 232 | | |
234 | 233 | | |
235 | 234 | | |
| |||
280 | 279 | | |
281 | 280 | | |
282 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
283 | 300 | | |
284 | 301 | | |
285 | 302 | | |
| |||
0 commit comments