-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Query: InvalidCastException on Where with Any #7657
Comments
EF Team Triage: This issue is lacking enough information for us to be able to effectively triage it. In particular, it is missing the following information requested in the new issue template. Can you please provide this information?
Ideally include a complete code listing that we can run to reproduce the issue. BTW we're not just doing this to be mean 😄... we get a lot traffic on this project and it takes time to attempt to reproduce an issue based on fragments of information. In addition, our attempt is often unsuccessful as the exact conditions required to hit the issue are often not explicitly included in the code provided. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we ask that folks give us a self contained way to reproduce an issue. For a guide on submitting good bug reports, read Painless Bug Tracking. BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions. |
Can you also let us know what version of EF Core you are using |
OK, sorry. OK, i will make a testsolution and load it up in the next days. At the moment the code is in a big projekt with totaly 43 projects in my solutionexplorer. btw: today i have changed this to this Now it will work. Maybe this also help you. Sorry for my mistake :-( |
Verified that this works in current bits, closing |
Hy all
In my model i have the Entity Businesspartner. The Businesspartner have a Property "Addresses"
Address have a Property ZipCity from type CityZip
CityZip have a Property PostCode
I will make a search, but if i search with the postcode or the City i get the following error:
System.InvalidCastException: Das Objekt des Typs "<SelectManyIterator>d__16
2[Microsoft.EntityFrameworkCore.Storage.Internal.InMemoryTableSnapshot,Microsoft.EntityFrameworkCore.Storage.ValueBuffer]" kann nicht in Typ "System.Collections.Generic.IEnumerable1[SPS.DMS.Model.Common.Address]" umgewandelt werden.
I have attached an Image from my model.

Here ist my Querycode:
` Dim bpQuery As IQueryable(Of BusinessPartner) = From bp As BusinessPartner In Ctx.BusinessPartners.Include(Function(i) i.Addresses).ThenInclude(Function(i1) i1.ZipCity)
Select bp
What is my mistake??
Thanks in advance for your time.
Best Regards
Sascha
The text was updated successfully, but these errors were encountered: