leftjoin-rightjoin-fulljoin-outerjoin
3.2.0
dotnet add package leftjoin-rightjoin-fulljoin-outerjoin --version 3.2.0
NuGet\Install-Package leftjoin-rightjoin-fulljoin-outerjoin -Version 3.2.0
<PackageReference Include="leftjoin-rightjoin-fulljoin-outerjoin" Version="3.2.0" />
paket add leftjoin-rightjoin-fulljoin-outerjoin --version 3.2.0
#r "nuget: leftjoin-rightjoin-fulljoin-outerjoin, 3.2.0"
// Install leftjoin-rightjoin-fulljoin-outerjoin as a Cake Addin #addin nuget:?package=leftjoin-rightjoin-fulljoin-outerjoin&version=3.2.0 // Install leftjoin-rightjoin-fulljoin-outerjoin as a Cake Tool #tool nuget:?package=leftjoin-rightjoin-fulljoin-outerjoin&version=3.2.0
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
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.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.
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