New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AutoMapper 4.1.0 Exception with Proxy on Inherited object with Entity Framework #945
Comments
Hmmm yeah, can you post what the source object types look like, in their full hierarchy? It looks like AutoMapper is going down the line here. |
The example @lbargaoanu did is spot on. The context of the "ParentTrainingCourseDto" is a way to limit through Automapper how much is filled in and prevent recursion from happening. We've gone a different route for the moment, but it seemed like a straight forward way to use the AutoMapper configuration vs. having to write a bunch of hand coded projections. |
#917 still fails. |
So these are different issues then. |
Well, they have the same root cause. Returning base destination types when we shouldn't. My fix may be arbitrary but it fixes both. |
What fix? |
Jeez that took like 2 seconds for me to find it sigh. Marking for 4.1.1, I want to get this one out ASAP |
Of course I replayed your last check in, but I don't know :) It feels like the source type should be the first. Not exactly an argument, I know. |
No that was just a guess of a fix, I didn't really like it. It makes some assumptions on the order of a SelectMany. If yours works I'll just revert my """"fix"""" |
@swilkos can you check the MyGet release? Just pushed a fix for this (and included integration tests to make sure this stays fixed). |
Will do and get back with you. |
My apologies, am new to working with MyGet. Using the URL https://www.myget.org/F/automapperdev/api/v2, Get-Package -ListAvailable shows now packages. Is there a different URL to work with? Thanks! |
That's the right URL, are you showing pre-release packages? |
Imagine that! Seems to be working as I'd expect it on my sample project. Will plug the pre-release into our main application later today and test it on a larger scale then the small example project I put together when tracking down what was happening. |
Is this problem is fix for you ? I have the same problem on my project with AutoMapper 4.1.1 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Seem to still have an issue with the latest build. When creating an Entity Framework query and attempting to map the object over to a derived class causes a base object mapping exception. Please let me know if more information is needed.
Classes:
Initializer:
Code that throws an excption with Automapper 4.1.0
Error thrown:
The text was updated successfully, but these errors were encountered: