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).
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();
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).