EntityFrameworkCore.MemoryJoin
0.9.0-beta1
dotnet add package EntityFrameworkCore.MemoryJoin --version 0.9.0-beta1
NuGet\Install-Package EntityFrameworkCore.MemoryJoin -Version 0.9.0-beta1
<PackageReference Include="EntityFrameworkCore.MemoryJoin" Version="0.9.0-beta1" />
paket add EntityFrameworkCore.MemoryJoin --version 0.9.0-beta1
#r "nuget: EntityFrameworkCore.MemoryJoin, 0.9.0-beta1"
// Install EntityFrameworkCore.MemoryJoin as a Cake Addin #addin nuget:?package=EntityFrameworkCore.MemoryJoin&version=0.9.0-beta1&prerelease // Install EntityFrameworkCore.MemoryJoin as a Cake Tool #tool nuget:?package=EntityFrameworkCore.MemoryJoin&version=0.9.0-beta1&prerelease
EntityFrameworkCore.MemoryJoin
Extension for EntityFramework for joins to in-memory data. Both Entity Framework 6 and Entity Framework Core are supported! Used SQL standard syntax.
Tested with: MSSQL, PostgreSQL, and SQLite. (others should also work as standard EF API and SQL standard syntax are used)
Usage
Internally MemoryJoin uses intermediate class for making queries. So you can either use your own or basically use built-in one. Like this:
protected DbSet<EntityFramework.MemoryJoin.QueryModelClass> QueryData { get; set; }
Or like this for EF Core
protected DbSet<EntityFrameworkCore.MemoryJoin.QueryModelClass> QueryData { get; set; }
Please note this DbSet is protected, so it can't be used by anybody, only MemoryJoin will access it. Another note: table for QueryModelClass is NOT required. It is used for internal mapping only. So if you use migrations - basically use -IgnoreChanges flag.
After DbSet is defined you can write as follows:
using EntityFramework.MemoryJoin
For EF Core:
using EntityFrameworkCore.MemoryJoin
Then
// get context
var context = CreateContext();
// define in-memory list
var queryData = new [] {
new { .StreetName = "Foo", .HouseNumber = 33 },
new { .StreetName = "Baz", .HouseNumber = 99 },
// can specify other objects here
};
// get queryable representation, using thing like AsQueryable() will not work
var queryable = context.FromLocalList(queryData);
// Write as complex query as you want now. Data will be sent to server for performing query. I.e.
var efQuery = from addr in context.Addresses
join el in queryList on
new { addr.StreetName, addr.HouseNumber } equals
new { el.StreetName, el.HouseNumber }
select new
{
addr.AddressId,
addr.CreatedAt,
addr.StreetName,
addr.HouseNumber,
el.Extra,
el.Integer,
el.Float
};
// Query will be executed on DB server
var = efQuery.ToList();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. 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 is compatible. 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. 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 | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCore 6.0
- Microsoft.EntityFrameworkCore (>= 6.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 6.0.0)
-
.NETFramework 4.5
- EntityFramework (>= 6.1.0)
-
.NETStandard 2.1
- Microsoft.EntityFrameworkCore (>= 3.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 3.0.0)
-
net7.0
- Microsoft.EntityFrameworkCore (>= 7.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 7.0.0)
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 |
---|---|---|
0.9.0-beta1 | 48,993 | 3/29/2023 |
0.8.1-beta1 | 337 | 2/20/2023 |
0.8.0 | 315,690 | 12/11/2021 |
0.7.6 | 83,204 | 4/2/2021 |
0.7.5 | 17,750 | 11/24/2020 |
0.7.0 | 38,740 | 4/18/2020 |
0.6.0 | 8,695 | 9/29/2019 |
0.5.7 | 9,401 | 8/15/2019 |
0.5.6 | 21,251 | 3/22/2019 |
0.5.5 | 631 | 3/18/2019 |
0.5.4 | 4,634 | 12/18/2018 |
0.5.3 | 46,523 | 4/6/2018 |
0.5.2 | 948 | 3/23/2018 |
0.5.1 | 941 | 3/22/2018 |
0.5.0 | 2,926 | 3/20/2018 |
Net7 supported