EF.Caching.Cache
1.0.1-alpha2
dotnet add package EF.Caching.Cache --version 1.0.1-alpha2
NuGet\Install-Package EF.Caching.Cache -Version 1.0.1-alpha2
<PackageReference Include="EF.Caching.Cache" Version="1.0.1-alpha2" />
<PackageVersion Include="EF.Caching.Cache" Version="1.0.1-alpha2" />
<PackageReference Include="EF.Caching.Cache" />
paket add EF.Caching.Cache --version 1.0.1-alpha2
#r "nuget: EF.Caching.Cache, 1.0.1-alpha2"
#addin nuget:?package=EF.Caching.Cache&version=1.0.1-alpha2&prerelease
#tool nuget:?package=EF.Caching.Cache&version=1.0.1-alpha2&prerelease
EntityFramework.Caching
Entity Framework does not currently support caching of query results. A sample EF Caching provider is available for Entity Framework version 5 and earlier but due to changes to the provider model this sample provider does not work with Entity Framework 6 and newer. This project is filling the gap by enabling caching of query results for Entity Framework 6.1 applications.
This created based on EFCache introduced by Pawel Kadluczka but with a main difference. My main approach here is to cache database entites as well as query results. this approach reduce queries sending to DB many many more than caching just query results.
How to get it
You can get it from NuGet - just install the EF.Caching.Cache NuGet package
If you wanna use Memory as cache provider, add package EF.Caching.InMemory NuGet package
If you prefer to use Redis as cache provider, use package EF.Caching.Redis.StackExchange NuGet package or EF.Caching.Redis.ServiceStack NuGet package
How to use it
To make it work, just add EntityFrameworkCache.Initialize()
method at app startup (before EF is used) and use proper config related to your cache provider:
In Memory:
EntityFrameworkCache.Initialize(new InMemoryCache());
Redis using ServiceStack library:
EntityFrameworkCache.Initialize(new ServiceStackRedisCache(new ServiceStackRedisCacheOptions
{
Host = "localhost"
}));
Redis using StackExchange library:
EntityFrameworkCache.Initialize(new StackExchangeRedisCache(new StackExchangeRedisCacheOptions()
{
Configuration = "localhost:6379"
}));
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.1
- EF.Caching.Abstractions (>= 1.0.2)
- EntityFramework (>= 6.2.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 |
---|---|---|
1.0.1-alpha2 | 953 | 3/17/2018 |
1.0.1-alpha | 889 | 3/13/2018 |