See the version list below for details.
dotnet add package Apizr.Extensions.Microsoft.Caching --version 4.1.0
NuGet\Install-Package Apizr.Extensions.Microsoft.Caching -Version 4.1.0
<PackageReference Include="Apizr.Extensions.Microsoft.Caching" Version="4.1.0" />
paket add Apizr.Extensions.Microsoft.Caching --version 4.1.0
#r "nuget: Apizr.Extensions.Microsoft.Caching, 4.1.0"
// Install Apizr.Extensions.Microsoft.Caching as a Cake Addin #addin nuget:?package=Apizr.Extensions.Microsoft.Caching&version=4.1.0 // Install Apizr.Extensions.Microsoft.Caching as a Cake Tool #tool nuget:?package=Apizr.Extensions.Microsoft.Caching&version=4.1.0
Refit based web api client management, but resilient (retry, connectivity, cache, auth, log, priority, etc...)
The Apizr project was motivated by this 2015 famous blog post about resilient networking.
Its main focus was to address at least everything explained into this article, meanning:
- Easy access to restful services
- Work offline with cache management
- Handle errors with retry pattern and global catching
- Handle request priority
- Check connectivity
- Fast development time
- Easy maintenance
- Reuse existing libraries
But also, some more core features like:
- Trace http traffic
- Handle authentication
And more integration/extension independent optional features like:
- Choose cache, log and connectivity providers
- Register it as an MS DI extension
- Integrate with Shiny
- Map model with DTO
- Use Mediator pattern
- Use Optional pattern
The list is not exhaustive, there’s more, but what we wanted was playing with all of it with as less code as we could, not worrying about plumbing things and being sure everything is wired and handled by design or almost.
Inspired by Refit.Insane.PowerPack, we wanted to make it simple to use, mixing attribute decorations and fluent configuration.
Also, we built this lib to make it work with any .Net Standard 2.0 compliant platform, so we could use it seamlessly from any kind of app, with or without DI goodness.
Install the NuGet package of your choice:
- Apizr package comes with the For and CrudFor static instantiation approach (which you can register in your DI container then)
- Apizr.Extensions.Microsoft.DependencyInjection package extends your IServiceCollection with AddApizr, AddApizrFor and AddApizrCrudFor registration methods
- Apizr.Extensions.Microsoft.Caching package brings an ICacheHandler method mapping implementation for MS Extensions Caching
- Apizr.Integrations.Akavache package brings an ICacheHandler method mapping implementation for Akavache
- Apizr.Integrations.MonkeyCache package brings an ICacheHandler method mapping implementation for MonkeyCache
- Apizr.Integrations.Fusillade package enables request priority management using Fusillade
- Apizr.Integrations.MediatR package enables request auto handling with mediation using MediatR
- Apizr.Integrations.Optional package enables Optional result from mediation requests (requires MediatR integration) using Optional.Async
- Apizr.Integrations.AutoMapper package enables auto mapping for mediation requests (requires MediatR integration and could work with Optional integration) using AutoMapper
Apizr core package make use of well known nuget packages to make the magic appear:
|Refit||Auto-implement web api interface and deal with HttpClient|
|Polly||Apply some policies like Retry, CircuitBreaker, etc...|
|Microsoft.Extensions.Logging.Abstractions||Delegate logging layer to MS Extensions Logging|
It also comes with some handling interfaces to let you provide your own services for:
- Caching with ICacheHandler, which comes with its default VoidCacheHandler (no cache), but also with:
- InMemoryCacheHandler & DistributedCacheHandler: MS Extensions Caching methods mapping interface (Integration package referenced above), meaning you can provide any compatible caching engine
- AkavacheCacheHandler: Akavache methods mapping interface (Integration package referenced above)
- MonkeyCacheHandler: MonkeyCache methods mapping interface (Integration package referenced above)
- Logging As Apizr relies on official MS ILogger interface, you may want to provide any compatible logging engine (built-in DebugLogger activated by default)
- Connectivity with IConnectivityHandler, which comes with its default VoidConnectivityHandler (no connectivity check)
- Mapping with IMappingHandler, which comes with its default VoidMappingHandler (no mapping conversion), but also with:
- AutoMapperMappingHandler: AutoMapper mapping methods mapping interface (Integration package referenced above)
|.NET||net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows|
|.NET Core||netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1|
|.NET Standard||netstandard2.0 netstandard2.1|
|.NET Framework||net461 net462 net463 net47 net471 net472 net48 net481|
- Apizr.Extensions.Microsoft.DependencyInjection (>= 4.1.0)
- Microsoft.Extensions.Caching.Abstractions (>= 6.0.0)
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.