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
<PackageReference Include="Cached-Attributes-NetCore" Version="5.1.0" />
paket add Cached-Attributes-NetCore --version 5.1.0
#r "nuget: Cached-Attributes-NetCore, 5.1.0"
// 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/
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 | Versions 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. |
-
net5.0
- Castle.Core (>= 4.4.1)
- Castle.Core.AsyncInterceptor (>= 1.7.0)
- Castle.Windsor.MsDependencyInjection (>= 3.4.0)
- LazyCache.AspNetCore (>= 2.1.2)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Logging.Abstractions (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.