Skip to content

leftOuterJoin is different from C# version, workaround doesn't work for double left join #6552

@Lanayx

Description

@Lanayx

I'm creating this issue as a discussion about leftOuterJoin operator. Current implementation is inconsistent with C# version and libraries are reluctant to support F# version as well which leads to lack of very useful tools.
For example let's take Linq2Db issue that is not fixed for years or SQLProvider workaround which introduced another operator.
The key issue can be visible here

C#

.GroupJoin(
   name,
   c => c.ParentId,
   p => p.ParentId,
   (o, gr) => new { o = o; gr = gr })
.SelectMany(
   t => t.gr.DefaultIfEmpty(),
   (o, i) => new { o = o; gr = gr; i = i}
)

F# equivalent when applying leftOuterJoin

.GroupJoin(
   name,
   c => c.ParentId,
   p => p.ParentId,
   (o, gr) => new { o = o; gr = gr.DefaultIfEmpty() })
.SelectMany(
   t => t.gr,
   (o, i) => new { o = o; gr = gr; i = i}
)

Microsoft documented C# behaviour of DefaultIfEmpty() insertion which is different from F# behaviour, which leads to the issues.
So my question is shouldn't a breaking change be made to equalize left joins and let F# developers use C# tools?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions