-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Join problem with inherited entities #614
Comments
Hello @Ibehem, Thanks for creating this issue. I did find the issue and I've corrected it. Do you want to test a preview version? Note that your join is not correct, it should be something like this: // Arrange
var magnus = new Person { Name = "Hedlund, Magnus" };
var terry = new Person { Name = "Adams, Terry" };
var charlotte = new Person { Name = "Weiss, Charlotte" };
var barley = new Pet { Name = "Barley", Owner = terry };
var boots = new Pet { Name = "Boots", Owner = terry };
var whiskers = new Pet { Name = "Whiskers", Owner = charlotte };
var daisy = new SpecialPet { Name = "Daisy", Owner = magnus, IsSpecial = true };
var people = new List<Person> { magnus, terry, charlotte };
var pets = new List<Pet> { barley, boots, whiskers, daisy };
// Act
var realQuery = people.AsQueryable()
.Join(
pets,
person => person,
pet => pet.Owner,
(person, pet) => new { OwnerName = person.Name, Pet = pet.Name });
var realResult = realQuery.ToList();
var dynamicQuery = people.AsQueryable()
.Join(
pets,
"it",
"Owner",
"new(outer.Name as OwnerName, inner.Name as Pet)");
var dynamicResult = dynamicQuery.ToDynamicList();
realResult.Should().BeEquivalentTo(dynamicResult); |
Hello Stef, Yes I would love to test a preview version ! And thank you very much for solving this so quickly! |
A preview ( See this link on how to use MyGet: CC: @EfrSyn / @Ibehem |
Hello @EfrSyn / @Ibehem, Did you have time to verify if this was solved using that preview version? |
1 similar comment
Hello @EfrSyn / @Ibehem, Did you have time to verify if this was solved using that preview version? |
Hello @EfrSyn / @Ibehem, Did you have time to verify if this was solved using that preview version? |
2 similar comments
Hello @EfrSyn / @Ibehem, Did you have time to verify if this was solved using that preview version? |
Hello @EfrSyn / @Ibehem, Did you have time to verify if this was solved using that preview version? |
PR merged |
When I try to join on a descendant of a class I got an error:
x and y are incompatible
While the same in Strongly typed Line works.
Based on the pets and person project:
https://dotnetfiddle.net/eEYaoU
Here is a sample:
I have a simple hierarchy:
The text was updated successfully, but these errors were encountered: