EfCoreExtensions.FindParent 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package EfCoreExtensions.FindParent --version 1.0.0
NuGet\Install-Package EfCoreExtensions.FindParent -Version 1.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="EfCoreExtensions.FindParent" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EfCoreExtensions.FindParent --version 1.0.0
#r "nuget: EfCoreExtensions.FindParent, 1.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.
// Install EfCoreExtensions.FindParent as a Cake Addin
#addin nuget:?package=EfCoreExtensions.FindParent&version=1.0.0

// Install EfCoreExtensions.FindParent as a Cake Tool
#tool nuget:?package=EfCoreExtensions.FindParent&version=1.0.0

FindParent

An entity framework core extension method to find a related parent entity any number of tables (or joins) away. Traverses the db context model to find the optimal join path, then dynamically generates a queryable of chained selects along the path. Example:

Say there is a table structure where Garages have multiple Cars, Cars have multiple Tires, and Tires have multiple Bolts. If you wanted to know the parent Garage of the Bolt with an Id of 1, you could get it via:

Garage garageFromBolt = context.FindParent<Bolt, Garage>(1).FirstOrDefault();

The method uses Dijkstra’s shortest path algorithm to find the shortest path to the parent (meaning the lowest number of required Navigation properties to Select).

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.0.0 273 2/4/2023
1.0.4 388 5/21/2022
1.0.3 404 5/21/2022
1.0.2 393 5/17/2022
1.0.1 367 5/17/2022
1.0.0 398 5/17/2022