CachedQueries 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package CachedQueries --version 1.0.1
NuGet\Install-Package CachedQueries -Version 1.0.1
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="CachedQueries" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CachedQueries --version 1.0.1
#r "nuget: CachedQueries, 1.0.1"
#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.
// Install CachedQueries as a Cake Addin
#addin nuget:?package=CachedQueries&version=1.0.1

// Install CachedQueries as a Cake Tool
#tool nuget:?package=CachedQueries&version=1.0.1

CachedQueries

License Build status Coverage Status CodeFactor

A library provides IQueryable results caching with smart invalidation.

Setup

Setup with DI

services.AddQueriesCaching(options =>
    options
        .UseCache<DistributedCache>()
        .UseEntityFramework());

...

app.UseQueriesCaching();

Or Setup with static class

CacheManager.Cache = new MyCacheImplementation();
CacheManager.CacheKeyFactory = new MyCacheKeyFactory();

Usage

Cache collection

var results = context.Blogs
    .Include(x => x.Posts)
    .ToCachedListAsync(cancellationToken);

Cache item

var results = context.Blogs
    .Include(x => x.Posts)
    .CachedFirstOrDefaultAsync(x => x.Id == request.Id, cancellationToken);

Invalidate cache

By default, all invalidation tags retrieved from Include and ThenInclude as navigation properties type names. To invalidate cache just call this extension before context save changes.

await context.ChangeTracker.ExpireEntitiesCacheAsync();
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

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.17 292 2/7/2023
1.0.16 69,215 1/31/2023
1.0.15 621 1/29/2023
1.0.14 1,076 1/25/2023
1.0.13 3,814 1/5/2023
1.0.12 4,349 12/7/2022
1.0.11 6,635 10/21/2022
1.0.10 11,180 7/14/2022
1.0.9 1,939 7/1/2022
1.0.8 397 7/1/2022
1.0.7 402 7/1/2022
1.0.6 11,991 4/11/2022
1.0.5 1,837 3/4/2022
1.0.4 696 2/24/2022
1.0.3 403 2/22/2022
1.0.2 402 2/22/2022
1.0.1 461 2/22/2022
1.0.0 495 2/22/2022