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
<PackageReference Include="Noticia.EntityFrameworkCore.MemoryJoin" Version="1.2.0" />
paket add Noticia.EntityFrameworkCore.MemoryJoin --version 1.2.0
#r "nuget: Noticia.EntityFrameworkCore.MemoryJoin, 1.2.0"
// 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
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 | Versions 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. |
-
net6.0
- Microsoft.EntityFrameworkCore.Relational (>= 6.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.