Skip to content

Unable to use Query<T1>().Include<T2>() when both T1 and T2 use soft deletes #631

Description

@barryhagan

If both types used in a Marten LINQ .Include() query are configured to use soft deletes, running an .Include() query will result in this exception:

[PostgresException (0x80004005): 42702: column reference "mt_deleted" is ambiguous]

It looks like the where clause to handle soft deletes is not scoped properly as d.mt_deleted. Instead, you get where (mt_deleted = False) in the generated command, causing the ambiguous table reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions