EntityFramework6.NCache
5.3.7
dotnet add package EntityFramework6.NCache --version 5.3.7
NuGet\Install-Package EntityFramework6.NCache -Version 5.3.7
<PackageReference Include="EntityFramework6.NCache" Version="5.3.7" />
<PackageVersion Include="EntityFramework6.NCache" Version="5.3.7" />
<PackageReference Include="EntityFramework6.NCache" />
paket add EntityFramework6.NCache --version 5.3.7
#r "nuget: EntityFramework6.NCache, 5.3.7"
#:package EntityFramework6.NCache@5.3.7
#addin nuget:?package=EntityFramework6.NCache&version=5.3.7
#tool nuget:?package=EntityFramework6.NCache&version=5.3.7
NCache Entity Framework 6
NCache Entity Framework 6 integration extends Entity Framework 6 with distributed query caching capabilities, allowing applications to cache the results of Entity Framework queries transparently. By intercepting database commands, repeated queries can be served directly from NCache, reducing database load and improving application performance.
The integration works without requiring changes to existing LINQ queries. Once configured, query caching is automatically applied through the Entity Framework command interceptor.
Key benefits:
- Distributed query caching for Entity Framework 6
- Transparent caching without modifying existing queries
- Supports both transactional and reference data caching
- Reduces repetitive database queries
- Improves application scalability and performance
Installation
Install-Package EntityFramework6.NCache
or, using the .NET CLI:
dotnet add package EntityFramework6.NCache
What is Installed
Installing this package adds the following NCache configuration files to your project:
- client.ncconf � Defines the cache client settings, including the cache name and the list of server nodes the client connects to.
- config.ncconf � Contains the cache configuration (cache topology, partitions, eviction policy, etc.) used when the cache is created or registered.
- tls.ncconf � Contains TLS/SSL settings used to secure communication between the client and the NCache cluster, if enabled.
Prerequisites
Before using this package, ensure you have:
- A running NCache Server cluster.
- The EntityFramework6.NCache package installed.
- Entity Framework 6 configured in your application.
- Ensure the entities being cached are serializable.
Getting Started
Setting up NCache
If NCache is not installed on the machine running your application, update the configuration files included with this package so the client can connect to your cache.
- Open
client.ncconf. - Locate the cache entry named
myCacheand replace it with the name of your cache. - Update the server address to point to a node hosting that cache.
Example:
<cache id="myCache" ... >
<server name="10.0.0.1" ... />
</cache>
Replace:
myCachewith the name of your cache.10.0.0.1with the hostname or IP address of an NCache server node.
Entity Framework Configuration
To enable query caching, register the NCache Entity Framework command interceptor in the entityFramework section of your application's configuration file.
<entityFramework>
...
<interceptors>
<interceptor type="Alachisoft.NCache.Integrations.EntityFramework.Caching.EFCommandInterceptor, Alachisoft.Integrations.EntityFramework.CachingProvider" />
</interceptors>
</entityFramework>
Once the interceptor is registered, Entity Framework queries are automatically intercepted and cached by NCache.
Query Caching
NCache transparently caches Entity Framework queries executed through your DbContext. The first execution retrieves data from the database and stores the results in NCache. Subsequent executions of the same query are served directly from the cache, reducing database round-trips and improving application performance.
No changes to existing LINQ queries are required.
References
Reference documentation is available at:
https://www.alachisoft.com/resources/docs/ncache/prog-guide/entity-framework.html
Resources
Technical Support
Alachisoft© provides various sources of technical support.
- Please refer to https://www.alachisoft.com/support.html to select a support resource suitable for your issue.
- To request additional features or report documentation issues, email support@alachisoft.com.
Copyright
Copyright � 2026 Alachisoft.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- Alachisoft.NCache.SDK (>= 5.3.7.2)
- EntityFramework (>= 6.1.3 && <= 6.5.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.