Cached-Attributes-NetCore 5.1.0

dotnet add package Cached-Attributes-NetCore --version 5.1.0                
NuGet\Install-Package Cached-Attributes-NetCore -Version 5.1.0                
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="Cached-Attributes-NetCore" Version="5.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cached-Attributes-NetCore --version 5.1.0                
#r "nuget: Cached-Attributes-NetCore, 5.1.0"                
#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 Cached-Attributes-NetCore as a Cake Addin
#addin nuget:?package=Cached-Attributes-NetCore&version=5.1.0

// Install Cached-Attributes-NetCore as a Cake Tool
#tool nuget:?package=Cached-Attributes-NetCore&version=5.1.0                

Cached Attributes by Interceptors NetCore3.1

Caching attributes via interceptors on .netcore3.1 and Castle Windsor.

Installation

https://www.nuget.org/packages/Cached-Attributes-NetCore/

nuget

Usage

Declare the attribute either on an interface method:

public interface IPowerPlantRepository : IPpmRepository<PowerPlant, long>
{
    Task<string> GetPowerPlantName(long? id);

    [CachePerRequest]
    Task<List<PowerPlant>> GetAllActive();
}

Or a virtual method of a class:

[AbpAllowAnonymous]
[Cache]
[DisableAuditing]
public virtual async Task<GetProfilePictureOutput> GetProfilePictureById(Guid profilePictureId)
{
    return await GetProfilePictureByIdInternal(profilePictureId);
}

Since it is a requirement for intercepting via Dynamic Proxying of Castle.

Cache Varies by Method Parameters:

Parameters are serialized to json objects via Newtonsoft.Json and if the same parameters are used for the call, the result will return from cache.

[CachePerRequest]

Using traceIdentifier of a webrequest, it caches the method result and prevents execution of the method with the same parameters.

[Cache]

Caches the method result globally, independent from the web request.

Installation

CacheInterceptorsNetCore on nuget.org, then;

In startup.cs, register LazyCache service which is a prerequisite of this libary:

services.AddLazyCache();

Then register CacheInterceptors using Castle kernel:

CacheInterceptorsRegistrar.RegisterCacheInterceptors(IocManager.IocContainer, "PPM");

where "PPM" is root namespace of our project. You should adjust it to your project accordingly. Our solution contains such projects

PPM.EntityFrameworkCore
PPM.Application
PPM.WebHost
etc...
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  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.

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
5.1.0 4,011 3/15/2021
5.0.6 952 1/13/2021
1.0.6 1,010 10/25/2020
1.0.5 1,185 6/23/2020
1.0.4 992 6/23/2020
1.0.3 992 6/23/2020
1.0.2 990 6/23/2020
1.0.1 931 6/2/2020