leftjoin-rightjoin-fulljoin-outerjoin 5.0.0

dotnet add package leftjoin-rightjoin-fulljoin-outerjoin --version 5.0.0
                    
NuGet\Install-Package leftjoin-rightjoin-fulljoin-outerjoin -Version 5.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="leftjoin-rightjoin-fulljoin-outerjoin" Version="5.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="leftjoin-rightjoin-fulljoin-outerjoin" Version="5.0.0" />
                    
Directory.Packages.props
<PackageReference Include="leftjoin-rightjoin-fulljoin-outerjoin" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add leftjoin-rightjoin-fulljoin-outerjoin --version 5.0.0
                    
#r "nuget: leftjoin-rightjoin-fulljoin-outerjoin, 5.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=leftjoin-rightjoin-fulljoin-outerjoin&version=5.0.0
                    
Install leftjoin-rightjoin-fulljoin-outerjoin as a Cake Addin
#tool nuget:?package=leftjoin-rightjoin-fulljoin-outerjoin&version=5.0.0
                    
Install leftjoin-rightjoin-fulljoin-outerjoin as a Cake Tool

leftjoin-rightjoin-fulljoin-outerjoin

Very simple Left/Right/FullOuterJoin extension methods for both IQueryable and IEnumerable types

In linq, if you need a left outer join, you have to use GroupJoin/Selectmany/DefaultIfEmpty blocks. There is another package in nuget containing similar extensions for only IEnumerable, which results in performance loss for database queries. For this need, I developed IQueryable versions.

Installation

nuget

Functionalities:

  • Left Join for IQueryables: Translated into database queries
  • Left Join for IEnumerables: In memory joining
  • Left Excluding Join for IQueryable/IEnumerables: Taking only Left side for matching items
  • Right Join for IQueryable
  • Right Join for IEnumerable
  • Right Excluding Join for IQueryable/IEnumerables
  • Full Outer Join for IQueryable
  • Full Outer Join for IEnumerable
  • Left Join for IEnumerable via ON statement condition: other overloads uses lambdas for LEFT=> key and RIGTH ⇒ key syntax, this overload uses (LEFT, RIGHT) ⇒ boolean syntax

Usage

For IQueryable:

JOIN TYPE METHOD NAME Example RETURN TYPE
LEFT JOIN LeftJoinExt() repository.GetAll().LeftJoinExt(roles, ur ⇒ ur.RoleId, role ⇒ role.Id) IQueryable<JoinItem<TLeft, TRight>>
LEFT EXCL JOIN LeftExcludingJoin() repository.GetAll().LeftExcludingJoinExt(roles, ur ⇒ ur.RoleId, role ⇒ role.Id) IQueryable<JoinItem<TLeft, TRight>>
RIGHT JOIN RightJoinExt() repository.GetAll().LeftExcludingJoinExt(roles, ur ⇒ ur.RoleId, role ⇒ role.Id) IQueryable<JoinItem<TLeft, TRight>>
RIGHT EXCL JOIN RightExcludingJoinExt() repository.GetAll().LeftExcludingJoinExt(roles, ur ⇒ ur.RoleId, role ⇒ role.Id) IQueryable<JoinItem<TLeft, TRight>>
INNER JOIN InnerJoinExt() repository.GetAll().InnerJoinExt(roles, ur ⇒ ur.RoleId, role ⇒ role.Id) IQueryable<JoinItem<TLeft, TRight>>
FULL JOIN FullOuterJoinExt() repository.GetAll().FullOuterJoinExt(roles, ur ⇒ ur.RoleId, role ⇒ role.Id) IQueryable<JoinItem<TLeft, TRight>>
FULL EXCL JOIN FullOuterExcludingJoinExt() repository.GetAll().FullOuterExcludingJoinExt(roles, ur ⇒ ur.RoleId, role ⇒ role.Id) IQueryable<JoinItem<TLeft, TRight>>

For IEnumerable:

JOIN TYPE METHOD NAME Example RETURN TYPE
LEFT JOIN LeftJoinExtEnumerable() repository.GetAll().LeftJoinExtEnumerable(roles, ur ⇒ ur.RoleId, role ⇒ role.Id) IEnumerable<JoinItem<TLeft, TRight>>
LeftJoinExtEnumerable() repository.GetAll().LeftJoinExtEnumerable(roles, ur ⇒ ur.RoleId, role ⇒ role.Id, (left, right)=> new {...}) IEnumerable< TResult >
LEFT EXCL JOIN LeftExcludingJoinExtEnumerable() repository.GetAll().LeftExcludingJoinExtEnumerable(roles, ur ⇒ ur.RoleId, role ⇒ role.Id, (left, right)=> new {...}) IEnumerable< TResult >
RIGHT JOIN RightJoinExtEnumerable() repository.GetAll().RightJoinExtEnumerable(roles, ur ⇒ ur.RoleId, role ⇒ role.Id, (left, right)=> new {...}) IEnumerable< TResult >
RIGHT EXCL JOIN RightExcludingJoinExtEnumerable() repository.GetAll().RightExcludingJoinExtEnumerable(roles, ur ⇒ ur.RoleId, role ⇒ role.Id, (left, right)=> new {...}) IEnumerable< TResult >
INNER JOIN InnerJoinExtEnumerable() repository.GetAll().InnerJoinExtEnumerable(roles, ur ⇒ ur.RoleId, role ⇒ role.Id) IEnumerable<JoinItem<TLeft, TRight>>
repository.GetAll().InnerJoinExtEnumerable(roles, ur ⇒ ur.RoleId, role ⇒ role.Id, (left, right)=> new {...}) IEnumerable< TResult >
FULL JOIN FullOuterJoinExtEnumerable() repository.GetAll().FullOuterJoinExtEnumerable(roles, ur ⇒ ur.RoleId, role ⇒ role.Id, (left, right)=> new {...}) IEnumerable< TResult >
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.0.0 59 18 days ago
3.2.0 16,276 3/4/2021
3.1.0 3,235 2/3/2021
3.0.1 2,128 5/11/2020
3.0.0 1,039 5/11/2020
2.2.0 1,738 3/12/2020
2.1.0 1,678 10/23/2019
2.0.2 1,101 10/21/2019
1.2.0 1,380 8/2/2019

v3.2 fullouterjoin not working, fixed
           v3.1 removed obsolete warnings, since they are well understood.
           v3.0 All extensions got Ext prefix, to seperate from EntityFramework LeftJoin like methods.
           v2.2 JointItem tostring method written
           v2.1 LeftJoin.IEnumerable: Join with condition method added
           v2.0 Linqkit and TResult projection for IQueryable removed. IQueryable methods now returning Tuples instead of TResult types given by the parameter Func