Flattening Nested Properties with In-Memory ProjectTo causes NRE #3691
richardlawley
started this conversation in
NA
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I use
ProjectTo
a lot for my EF6 code, but the same code runs with in-memory Queryables for the purpose of Unit Tests. Previously with 10.0.0 I had to add explicit conditions when flattening a nullable second-level property into a DTO - since 10.1.1 this has changed again so it is also needed with Non-Nullable properties. NormalMap<T>
calls handle this without any configuration.The main problem with this is that my profiles need contain mapping instructions which are only needed for in-memory unit tests, which is obviously undesirable.
Gist
Source/destination types
Mapping configuration
Version: 10.1.1
(on net472). Also tested with latest myget version.
Expected behavior
Properties from
Parent
flatten correctly to nullable destination properties without explicit configuration. In 10.0.0, this worked for Nullable nested properties.Actual behavior
NRE if Parent is null and no explicit configuration
Steps to reproduce
Beta Was this translation helpful? Give feedback.
All reactions