Skip to content

Set operations: infer type mappings from the other side #29081

@roji

Description

@roji

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

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions