Replies: 1 comment 1 reply
-
No idea because all we do is create a LINQ Select call, there's not really good places for "hooks" for additional behavior. It would have to be an analyzer I think? |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
So @jbogard, we had a fun bug today due to a FirstOrDefault after a ProjectTo. We eventually figured it out & saw the docs call out that this is a bad idea (and it makes sense), but I wonder if there’s a way to have automapper prevent that from being done in the first place.
Ideally there could be a safeguard built into the lib to make sure it's at the end of a chain (and maybe even that it's an entity), but not sure what that would look like. A Roslyn analyzer could work, but won't do much good if people don't install it.
I'd be down to take a crack at a PR here, but not sure where to start.
Beta Was this translation helpful? Give feedback.
All reactions