-
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
Set operations: allow operands with different entity types #16298
Comments
Disabled support for siblings of differing entity types, dotnet#16298
Disabled support for siblings of differing entity types, dotnet#16298
Disabled support for siblings of differing entity types, #16298
Disabled support for siblings of differing entity types, dotnet#16298
Disabled support for siblings of differing entity types, #16298
Disabled support for siblings of differing entity types, #16298
@roji Will this be fixed in the 3.0 release? |
@snailcatcher unfortunately no, this has been punted for post-3.0 work, but we'll definitely consider this as a high-priority item for the next release. However, note that you can still perform any sort of set operation on the client via client evaluation - simply insert an |
Added support for set operations over different entity types. When performing a set operation, if two properties in the entity inheritance hierarchy were mapped to the same database column, that column was projected twice. Closes dotnet#16298 Fixes dotnet#18832
Added support for set operations over different entity types. When performing a set operation, if two properties in the entity inheritance hierarchy were mapped to the same database column, that column was projected twice. Closes dotnet#16298 Fixes dotnet#18832
Added support for set operations over different entity types. When performing a set operation, if two properties in the entity inheritance hierarchy were mapped to the same database column, that column was projected twice. Closes dotnet#16298 Fixes dotnet#18832
according to this issue, if i have this setup
DbContext
I cannot perform a
except in memory via AsEnumerable()? you might want to answer this question as well :) |
Why has this not been considered important enough to implement before 7.0? It really makes it difficult to work with EF when this is needed. Is there a workaround that can be offered? Any comments on using |
This issue has 9 votes (👍). This puts it in 164th position in the list of most requested features. See the planning process for more information on how we decide what to work on. Make sure to vote for this issue if it is important to you. |
Using Convert.ToString() should be a good workaround.
What makes you think that, can you provide more details? |
I am not sure how |
@mhDuke see #29027, which is what @SoftCircuits was referring to above. |
Got same issue with owned types like:
and the query
|
Also just run into this while migrating from EF6 to EFC, similiar construct as Pavel: var entityOnes= Entities1
.Select(entity1 => new EntityView
{
Id = entity1 .Id,
Description = entity1.Name + " / " + entity1.Street
});
var entityTwoes= Entities2
.Select(entity2=> new EntityView
{
Id = entity2.PortfolioId,
Description = entity2.Risk
});
return entityOnes.Concat(entityTwoes).ToList(); Using |
Our current set operation support requires that both siblings have the exact same entity type. Quite a lot of logic is already in place for different entity types (of the same hierarchy), but the feature is currently disabled.
The issue is that when performing a set operation over two different siblings, null projections have to be injected, as the two siblings don't have the same set of properties. In addition, since the entire set operation is cast up to return the closest common ancestor of the two siblings, we also need to inject nulls for properties of unrelated siblings, since the shaper expects them there.
We currently lack a way to represent these null constants in the projection mappings of the set operation. Project mappings typically contain ColumnExpressions, but in our case there is no subquery table alias (since union operands don't have an alias).This should no longer be an issue after #17340.The text was updated successfully, but these errors were encountered: