Add test for collection aggregate mapping issue #171
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR relates to AutoMapper/AutoMapper#4329. While the bug is in AutoMapper, the result is quite unexpected. The first test will pass, but the second test throws the following exception:
I'm not sure if AutoMapper or AutoMapper.Extensions.ExpressionMapping is to blame for this rather inconvenient exception, but using the workaround described in the AutoMapper issue does resolve this problem as well. Nevertheless it would be nice if AutoMapper.Extensions.ExpressionMapping could fail early while building the expression, with a proper reason why it can't resolve the correct expression. If AutoMapper is still to blame for this part as well, then maybe a unit test can be produced to prevent future regressions in that area.