Noticia.EntityFrameworkCore.MemoryJoin 1.2.0

dotnet add package Noticia.EntityFrameworkCore.MemoryJoin --version 1.2.0                
NuGet\Install-Package Noticia.EntityFrameworkCore.MemoryJoin -Version 1.2.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="Noticia.EntityFrameworkCore.MemoryJoin" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Noticia.EntityFrameworkCore.MemoryJoin --version 1.2.0                
#r "nuget: Noticia.EntityFrameworkCore.MemoryJoin, 1.2.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 Noticia.EntityFrameworkCore.MemoryJoin as a Cake Addin
#addin nuget:?package=Noticia.EntityFrameworkCore.MemoryJoin&version=1.2.0

// Install Noticia.EntityFrameworkCore.MemoryJoin as a Cake Tool
#tool nuget:?package=Noticia.EntityFrameworkCore.MemoryJoin&version=1.2.0                

Nuget .NET CI License: MIT CodeQL

This package allows passing memory data to the EFcore provider which are able to be LINQed by the server without client evaluation.

Installation

dotnet add package Noticia.EntityFrameworkCore.MemoryJoin

Usage

You need to register models that you want to pass to the server in your database context:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    base.OnModelCreating(modelBuilder);

    modelBuilder.MemoryEntity<TestModel>();
}

Note that TestModel must not have a property named Id. This package auto-generates the underlying entity type via reflection and requires this property internally. The memory entities do not require a real table. They only need to be registered in the DbContext. For migrations you can safely use methods to disable this command (i.e. preprocessor directives checking whether migrations are running).

For generating the server-known entities you call:

dbContext.AsMemoryEntities(models);

For better unit testing IQueryableModelsBuilder has been added. The default implementation QueryableModelsBuilder may be initialized with a DbContext and the Build method with the models to be made queryable. By using your own implementation of IQueryableModelsBuilder unit testing may be simplified since no DbContext is required and simple stubs can be returned.

The given reference can be passed to the LINQ join method:

.Join(memoryEntities, ...)

This package was developed for using with OData and AutoMapper. Since all evaluation occurs on the server-side AutoMappers .ProjectTo is fully supported, even when passing your client side data.

Huge thanks to EntityFramework.MemoryJoin. This package has largely been based on their work.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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
1.2.0 14,325 4/2/2022
1.1.0 423 4/2/2022
1.0.1 434 4/1/2022
1.0.0 138 4/1/2022