EF.Caching.Cache 1.0.1-alpha2

This is a prerelease version of EF.Caching.Cache.
dotnet add package EF.Caching.Cache --version 1.0.1-alpha2
                    
NuGet\Install-Package EF.Caching.Cache -Version 1.0.1-alpha2
                    
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="EF.Caching.Cache" Version="1.0.1-alpha2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EF.Caching.Cache" Version="1.0.1-alpha2" />
                    
Directory.Packages.props
<PackageReference Include="EF.Caching.Cache" />
                    
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 EF.Caching.Cache --version 1.0.1-alpha2
                    
#r "nuget: EF.Caching.Cache, 1.0.1-alpha2"
                    
#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.
#addin nuget:?package=EF.Caching.Cache&version=1.0.1-alpha2&prerelease
                    
Install EF.Caching.Cache as a Cake Addin
#tool nuget:?package=EF.Caching.Cache&version=1.0.1-alpha2&prerelease
                    
Install EF.Caching.Cache as a Cake Tool

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 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. 
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.0.1-alpha2 953 3/17/2018
1.0.1-alpha 889 3/13/2018