Simple caching layer for data fetching
You can install NQuery with NuGet:
Install-Package NQuery
Or for Redis
Install-Package NQuery.Redis
Or via the .NET Core command line interface:
dotnet add package NQuery
Or for Redis
dotnet add package NQuery
You can use NQuery as
var query = NQuery.Create(new NQueryConfiguration{
UseInMemory = true
});
await query.Query( "query-key", await () => QueryYourData() );
Or for Asp.net Core Dependency for Redis as
services.AddNQuery(cfg =>
{
cfg.UseRedis(opts =>
{
opts.Endpoints.Add(new RedisEndpoint() { Host = "localhost", Port = 6379 });
});
})
See Test