EntityFrameworkCore.Projectables.Abstractions 6.0.0

dotnet add package EntityFrameworkCore.Projectables.Abstractions --version 6.0.0
                    
NuGet\Install-Package EntityFrameworkCore.Projectables.Abstractions -Version 6.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="EntityFrameworkCore.Projectables.Abstractions" Version="6.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EntityFrameworkCore.Projectables.Abstractions" Version="6.0.0" />
                    
Directory.Packages.props
<PackageReference Include="EntityFrameworkCore.Projectables.Abstractions" />
                    
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 EntityFrameworkCore.Projectables.Abstractions --version 6.0.0
                    
#r "nuget: EntityFrameworkCore.Projectables.Abstractions, 6.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.
#:package EntityFrameworkCore.Projectables.Abstractions@6.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EntityFrameworkCore.Projectables.Abstractions&version=6.0.0
                    
Install as a Cake Addin
#tool nuget:?package=EntityFrameworkCore.Projectables.Abstractions&version=6.0.0
                    
Install as a Cake Tool

EntityFrameworkCore.Projectables

Flexible projection magic for EF Core

NuGet version (EntityFrameworkCore.Projectables) .NET

NuGet packages

  • EntityFrameworkCore.Projectables.Abstractions NuGet version NuGet
  • EntityFrameworkCore.Projectables NuGet version NuGet

Starting with V2 of this project we're binding against EF Core 6. If you're targeting EF Core 5 or EF Core 3.1 then you can use the latest v1 release. These are functionally equivalent.

Getting started

  1. Install the package from NuGet
  2. Enable Projectables in your DbContext by adding: dbContextOptions.UseProjectables()
  3. Mark properties, methods, or constructors with [Projectable].
  4. Read the documentation for guides, reference, and recipes.

Example

class Order
{
    public decimal TaxRate { get; set; }
    public ICollection<OrderItem> Items { get; set; }

    [Projectable] public decimal Subtotal => Items.Sum(item => item.Product.ListPrice * item.Quantity);
    [Projectable] public decimal Tax => Subtotal * TaxRate;
    [Projectable] public decimal GrandTotal => Subtotal + Tax;
}

public static class UserExtensions
{
    [Projectable]
    public static Order GetMostRecentOrder(this User user) =>
        user.Orders.OrderByDescending(x => x.CreatedDate).FirstOrDefault();
}

var result = dbContext.Users
    .Where(u => u.UserName == "Jon")
    .Select(u => new { u.GetMostRecentOrder().GrandTotal })
    .FirstOrDefault();

The properties are inlined into SQL — no client-side evaluation, no N+1.

How it works

There are two components: a Roslyn source generator that emits companion Expression<TDelegate> trees for each [Projectable] member at compile time, and a runtime interceptor that walks your LINQ queries and substitutes those expressions before EF Core translates them to SQL.

Features (v6.x+)

Feature Docs
Properties & methods Guide →
Extension methods Guide →
Constructor projections Guide →
Method overloads Fully supported
Pattern matching (switch, is) Reference →
Block-bodied members (experimental) Advanced →
Null-conditional rewriting Reference →
Enum method expansion Reference →
UseMemberBody Reference →
Roslyn analyzers & code fixes (EFP0001–EFP0012) Reference →
Limited/Full compatibility mode Reference →

FAQ

Is this specific to a database provider?

No. The interceptor hooks into EF Core's query compilation pipeline before any provider-specific translation, so it works with SQL Server, PostgreSQL, SQLite, Cosmos DB, and any other EF Core provider.

Are there performance implications?

Two compatibility modes are available: Full (default) expands every query before handing it to EF Core; Limited expands once and caches the result. Limited mode often outperforms plain EF Core on repeated queries. See the Compatibility Mode docs.

Can I compose projectables?

Yes — a [Projectable] member can call other [Projectable] members. They are recursively inlined into the final SQL.

How does this relate to Expressionify?

Expressionify has overlapping features and a similar approach but a narrower scope. Projectables adds constructor projections, pattern matching, block-bodied members, enum expansion, and a richer diagnostics layer.

How does this relate to LinqKit/LinqExpander?

LinqKit and similar libraries predate source generators. Projectables (and Expressionify) are superior approaches for modern .NET because the source generator does the heavy lifting at compile time with no runtime reflection.

What .NET and EF Core versions are supported?
  • v1.x → EF Core 3.1 / 5
  • v2.x–v3.x → EF Core 6 / 7
  • v6.x+ → EF Core 6+ (current; targets net8.0 and net10.0)
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EntityFrameworkCore.Projectables.Abstractions:

Package Downloads
EntityFrameworkCore.Projectables

Project over properties and functions in your linq queries

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.0.0 28 3/26/2026
5.0.2 25,199 2/13/2026
5.0.1 25,229 1/15/2026
4.1.0-preview.1 2,886 8/13/2025
4.0.0 791,240 12/7/2024
4.0.0-preview.4 66,337 8/18/2024
3.0.4 939,574 8/30/2023
3.0.3 158,817 5/4/2023
3.0.2 133,469 3/16/2023
3.0.1 1,323 3/9/2023
3.0.0 3,785 3/2/2023
3.0.0-beta.1 9,249 10/13/2022
2.3.1-beta.1 1,900 10/5/2022
2.3.0 108,971 8/3/2022
2.3.0-beta.1 282 7/8/2022
2.2.0 8,816 4/28/2022
2.1.1 6,226 1/12/2022
Loading failed