Set operations: infer type mappings from the other side
Open
area-query
area-set-operations
customer-reported
needs-design
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
When performing set operations, if a constant/parameter is specified, we should infer the type mapping from the column on the other side. Currently, queries which do this frequently fail since we don't support any type/facet mismatch between the two sides (e.g. #19129).
```c#
var test = await DbContext.Foo
.Select(f => new
{
FooProp = f.FooProp,
BarProp = "SomeBar"
})
.Union(DbContext.Bar
.Select(b => new
{
FooProp = "SomeFoo",
BarProp = b.Bar
}))
.ToListAsync();
```
Contributor guide
Assessment
This issue has not been assessed yet.