diff --git a/Apizr/Docs/Apizr.Docs/index.md b/Apizr/Docs/Apizr.Docs/index.md index b7f5800b..54b7fd33 100644 --- a/Apizr/Docs/Apizr.Docs/index.md +++ b/Apizr/Docs/Apizr.Docs/index.md @@ -53,13 +53,13 @@ namespace Apizr.Sample { // (Refit) Define your web api interface methods [Get("/api/users")] - Task GetUsersAsync(); + Task GetUsersAsync([RequestOptions] IApizrRequestOptions options); [Get("/api/users/{userId}")] - Task GetUserAsync([CacheKey] int userId); + Task GetUserAsync([CacheKey] int userId, [RequestOptions] IApizrRequestOptions options); [Post("/api/users")] - Task CreateUser(User user); + Task CreateUser(User user, [RequestOptions] IApizrRequestOptions options); } } ``` @@ -137,7 +137,7 @@ var reqResManager = serviceProvider.GetRequiredService api.GetUsersAsync()); +var userList = await reqResManager.ExecuteAsync((api, opt) => api.GetUsersAsync(opt)); ``` This request will be managed with the defined resilience strategies, data cached and all logged. diff --git a/Apizr/Tools/Apizr.Tools.NSwag/Apizr.Tools.NSwag.csproj b/Apizr/Tools/Apizr.Tools.NSwag/Apizr.Tools.NSwag.csproj index d7bc84a9..c5eff0f9 100644 --- a/Apizr/Tools/Apizr.Tools.NSwag/Apizr.Tools.NSwag.csproj +++ b/Apizr/Tools/Apizr.Tools.NSwag/Apizr.Tools.NSwag.csproj @@ -8,7 +8,7 @@ apizr Apizr.Tools.NSwag - 6.0.0-preview.5 + 6.0.0-preview.6 An Apizr .NET Tool to generate models, interfaces and registration methods from a swagger url Respawnsive Refit Web Api Generator CLI diff --git a/README.md b/README.md index 2466a27a..c606e046 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Apizr -Refit based web api client, but resilient (retry, connectivity, cache, auth, log, priority...) +Refit based web api client management, but resilient (retry, connectivity, cache, auth, log, priority, etc...) -[![Read - Documentation](https://img.shields.io/badge/read-documentation-blue?style=for-the-badge)](https://apizr.net/ "Go to project documentation") +[![Read - Documentation](https://img.shields.io/badge/read-documentation-blue?style=for-the-badge)](https://apizr.net "Go to project documentation") ## What @@ -37,8 +37,6 @@ The list is not exhaustive, there Inspired by [Refit.Insane.PowerPack](https://github.com/thefex/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. - ## How An api definition with some attributes: @@ -55,13 +53,13 @@ namespace Apizr.Sample { // (Refit) Define your web api interface methods [Get("/api/users")] - Task GetUsersAsync(); + Task GetUsersAsync([RequestOptions] IApizrRequestOptions options); [Get("/api/users/{userId}")] - Task GetUserAsync([CacheKey] int userId); + Task GetUserAsync([CacheKey] int userId, [RequestOptions] IApizrRequestOptions options); [Post("/api/users")] - Task CreateUser(User user); + Task CreateUser(User user, [RequestOptions] IApizrRequestOptions options); } } ``` @@ -118,7 +116,6 @@ var reqResManager = ApizrBuilder.Current.CreateManagerFor( Relies on `IServiceCollection` extension methods approach. ```csharp - // (Logger) Configure logging the way you want, like services.AddLogging(loggingBuilder => loggingBuilder.AddDebug()); @@ -140,16 +137,17 @@ var reqResManager = serviceProvider.GetRequiredService api.GetUsersAsync()); +var userList = await reqResManager.ExecuteAsync((api, opt) => api.GetUsersAsync(opt)); ``` This request will be managed with the defined resilience strategies, data cached and all logged. -Apizr has a lot more to offer, just [read the doc](https://apizr.net)! +Apizr has a lot more to offer, just [read the doc](https://apizr.net/articles/index.md)! -## Where +- Please read the [Change Log](https://apizr.net/changelog.md) to get a picture of what's in. +- Please read the [Breaking changes](https://apizr.net/articles/breakingchanges.md) to get a picture of what's changed. -[Change Log](CHANGELOG.md) +## Where ### Managing (Core) @@ -207,7 +205,8 @@ Install the NuGet reference package of your choice: - **Apizr.Integrations.MediatR** package enables request auto handling with mediation using [MediatR](https://github.com/jbogard/MediatR) - **Apizr.Integrations.Optional** package enables Optional result from mediation requests (requires MediatR integration) using [Optional.Async](https://github.com/dnikolovv/optional-async) - **Apizr.Integrations.AutoMapper** package enables data mapping using [AutoMapper](https://github.com/AutoMapper/AutoMapper) - - **Apizr.Integrations.Mapster** package enables data mapping using [Mapster](https://github.com/MapsterMapper/Mapster)- **Apizr.Integrations.FileTransfer** package enables file transfer management for static registration + - **Apizr.Integrations.Mapster** package enables data mapping using [Mapster](https://github.com/MapsterMapper/Mapster) + - **Apizr.Integrations.FileTransfer** package enables file transfer management for static registration - **Apizr.Extensions.Microsoft.FileTransfer** package enables file transfer management for extended registration - **Apizr.Integrations.FileTransfer.MediatR** package enables file transfer management for mediation requests (requires MediatR integration and could work with Optional integration) using [MediatR](https://github.com/jbogard/MediatR) - **Apizr.Integrations.FileTransfer.Optional** package enables file transfer management for mediation requests with optional result (requires MediatR integration and could work with Optional integration) using [Optional.Async](https://github.com/dnikolovv/optional-async) diff --git a/docs/index.html b/docs/index.html index f0cb4fab..f9cb78b6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -117,13 +117,13 @@

How

{ // (Refit) Define your web api interface methods [Get("/api/users")] - Task<UserList> GetUsersAsync(); + Task<UserList> GetUsersAsync([RequestOptions] IApizrRequestOptions options); [Get("/api/users/{userId}")] - Task<UserDetails> GetUserAsync([CacheKey] int userId); + Task<UserDetails> GetUserAsync([CacheKey] int userId, [RequestOptions] IApizrRequestOptions options); [Post("/api/users")] - Task<User> CreateUser(User user); + Task<User> CreateUser(User user, [RequestOptions] IApizrRequestOptions options); } } @@ -201,7 +201,7 @@

How

And then you're good to go:

-
var userList = await reqResManager.ExecuteAsync(api => api.GetUsersAsync());
+
var userList = await reqResManager.ExecuteAsync((api, opt) => api.GetUsersAsync(opt));
 

This request will be managed with the defined resilience strategies, data cached and all logged.

Apizr has a lot more to offer, just read the doc!

diff --git a/docs/index.json b/docs/index.json index 6f570791..38d5fd23 100644 --- a/docs/index.json +++ b/docs/index.json @@ -3292,6 +3292,6 @@ "index.html": { "href": "index.html", "title": "Apizr | Apizr", - "keywords": "Apizr Refit based web api client management, but resilient (retry, connectivity, cache, auth, log, priority, etc...) What 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 Map model with DTO Use Mediator pattern Use Optional pattern Manage file transfers 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. How An api definition with some attributes: // (Polly) Define a resilience pipeline key [assembly:ResiliencePipeline(\"TransientHttpError\")] namespace Apizr.Sample { // (Apizr) Define your web api base url and ask for cache and logs [BaseAddress(\"https://reqres.in/\"), Cache(CacheMode.GetAndFetch, \"01:00:00\"), Log(HttpMessageParts.AllButBodies)] public interface IReqResService { // (Refit) Define your web api interface methods [Get(\"/api/users\")] Task GetUsersAsync(); [Get(\"/api/users/{userId}\")] Task GetUserAsync([CacheKey] int userId); [Post(\"/api/users\")] Task CreateUser(User user); } } Some resilience strategies: // (Polly) Create a resilience pipeline with some strategies var resiliencePipelineBuilder = new ResiliencePipelineBuilder() // Configure telemetry to get some logs from Polly process .ConfigureTelemetry(LoggerFactory.Create(loggingBuilder => loggingBuilder.Debug())) // Add a retry strategy with some options .AddRetry( new RetryStrategyOptions { ShouldHandle = new PredicateBuilder() .Handle() .HandleResult(response => response.StatusCode is >= HttpStatusCode.InternalServerError or HttpStatusCode.RequestTimeout), Delay = TimeSpan.FromSeconds(1), MaxRetryAttempts = 3, UseJitter = true, BackoffType = DelayBackoffType.Exponential })); An instance of this managed api: Static Extended Relies on static builder instantiation approach. // (Polly) Add the resilience pipeline with its key to a registry var resiliencePipelineRegistry = new ResiliencePipelineRegistry(); resiliencePipelineRegistry.TryAddBuilder(\"TransientHttpError\", (builder, _) => builder.AddPipeline(resiliencePipelineBuilder.Build())); // (Apizr) Get your manager instance var reqResManager = ApizrBuilder.Current.CreateManagerFor( options => options // With a logger .WithLoggerFactory(LoggerFactory.Create(loggingBuilder => loggingBuilder.Debug())) // With the defined resilience pipeline registry .WithResiliencePipelineRegistry(resiliencePipelineRegistry) // And with a cache handler .WithAkavacheCacheHandler()); Relies on IServiceCollection extension methods approach. // (Logger) Configure logging the way you want, like services.AddLogging(loggingBuilder => loggingBuilder.AddDebug()); // (Apizr) Add an Apizr manager for the defined api to your container services.AddApizrManagerFor(options => // With a cache handler options.WithAkavacheCacheHandler()); // (Polly) Add the resilience pipeline with its key to your container services.AddResiliencePipeline(\"TransientHttpError\", builder => builder.AddPipeline(resiliencePipelineBuilder.Build())); ... // (Apizr) Get your manager instance the way you want, like var reqResManager = serviceProvider.GetRequiredService>(); And then you're good to go: var userList = await reqResManager.ExecuteAsync(api => api.GetUsersAsync()); This request will be managed with the defined resilience strategies, data cached and all logged. Apizr has a lot more to offer, just read the doc! Please read the Change Log to get a picture of what's in. Please read the Breaking changes to get a picture of what's changed. Where Managing (Core) Project Current Upcoming Apizr Apizr.Extensions.Microsoft.DependencyInjection Caching Project Current Upcoming Apizr.Extensions.Microsoft.Caching Apizr.Integrations.Akavache Apizr.Integrations.MonkeyCache Handling Project Current Upcoming Apizr.Integrations.Fusillade Apizr.Integrations.MediatR Apizr.Integrations.Optional Mapping Project Current Upcoming Apizr.Integrations.AutoMapper Apizr.Integrations.Mapster Transferring Project Current Upcoming Apizr.Integrations.FileTransfer Apizr.Extensions.Microsoft.FileTransfer Apizr.Integrations.FileTransfer.MediatR Apizr.Integrations.FileTransfer.Optional Generating Project Current Upcoming Apizr.Tools.NSwag Install the NuGet reference package of your choice: Apizr package comes with the static builder 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 data mapping using AutoMapper Apizr.Integrations.Mapster package enables data mapping using Mapster Apizr.Integrations.FileTransfer package enables file transfer management for static registration Apizr.Extensions.Microsoft.FileTransfer package enables file transfer management for extended registration Apizr.Integrations.FileTransfer.MediatR package enables file transfer management for mediation requests (requires MediatR integration and could work with Optional integration) using MediatR Apizr.Integrations.FileTransfer.Optional package enables file transfer management for mediation requests with optional result (requires MediatR integration and could work with Optional integration) using Optional.Async Install the NuGet .NET CLI Tool package if needed: Apizr.Tools.NSwag package enables Apizr files generation by command lines (Models, Apis and Registrations) from an OpenApi/Swagger definition using NSwag Apizr core package make use of well known nuget packages to make the magic appear: Package Features 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) MapsterMappingHandler: Mapster mapping methods mapping interface (Integration package referenced above)" + "keywords": "Apizr Refit based web api client management, but resilient (retry, connectivity, cache, auth, log, priority, etc...) What 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 Map model with DTO Use Mediator pattern Use Optional pattern Manage file transfers 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. How An api definition with some attributes: // (Polly) Define a resilience pipeline key [assembly:ResiliencePipeline(\"TransientHttpError\")] namespace Apizr.Sample { // (Apizr) Define your web api base url and ask for cache and logs [BaseAddress(\"https://reqres.in/\"), Cache(CacheMode.GetAndFetch, \"01:00:00\"), Log(HttpMessageParts.AllButBodies)] public interface IReqResService { // (Refit) Define your web api interface methods [Get(\"/api/users\")] Task GetUsersAsync([RequestOptions] IApizrRequestOptions options); [Get(\"/api/users/{userId}\")] Task GetUserAsync([CacheKey] int userId, [RequestOptions] IApizrRequestOptions options); [Post(\"/api/users\")] Task CreateUser(User user, [RequestOptions] IApizrRequestOptions options); } } Some resilience strategies: // (Polly) Create a resilience pipeline with some strategies var resiliencePipelineBuilder = new ResiliencePipelineBuilder() // Configure telemetry to get some logs from Polly process .ConfigureTelemetry(LoggerFactory.Create(loggingBuilder => loggingBuilder.Debug())) // Add a retry strategy with some options .AddRetry( new RetryStrategyOptions { ShouldHandle = new PredicateBuilder() .Handle() .HandleResult(response => response.StatusCode is >= HttpStatusCode.InternalServerError or HttpStatusCode.RequestTimeout), Delay = TimeSpan.FromSeconds(1), MaxRetryAttempts = 3, UseJitter = true, BackoffType = DelayBackoffType.Exponential })); An instance of this managed api: Static Extended Relies on static builder instantiation approach. // (Polly) Add the resilience pipeline with its key to a registry var resiliencePipelineRegistry = new ResiliencePipelineRegistry(); resiliencePipelineRegistry.TryAddBuilder(\"TransientHttpError\", (builder, _) => builder.AddPipeline(resiliencePipelineBuilder.Build())); // (Apizr) Get your manager instance var reqResManager = ApizrBuilder.Current.CreateManagerFor( options => options // With a logger .WithLoggerFactory(LoggerFactory.Create(loggingBuilder => loggingBuilder.Debug())) // With the defined resilience pipeline registry .WithResiliencePipelineRegistry(resiliencePipelineRegistry) // And with a cache handler .WithAkavacheCacheHandler()); Relies on IServiceCollection extension methods approach. // (Logger) Configure logging the way you want, like services.AddLogging(loggingBuilder => loggingBuilder.AddDebug()); // (Apizr) Add an Apizr manager for the defined api to your container services.AddApizrManagerFor(options => // With a cache handler options.WithAkavacheCacheHandler()); // (Polly) Add the resilience pipeline with its key to your container services.AddResiliencePipeline(\"TransientHttpError\", builder => builder.AddPipeline(resiliencePipelineBuilder.Build())); ... // (Apizr) Get your manager instance the way you want, like var reqResManager = serviceProvider.GetRequiredService>(); And then you're good to go: var userList = await reqResManager.ExecuteAsync((api, opt) => api.GetUsersAsync(opt)); This request will be managed with the defined resilience strategies, data cached and all logged. Apizr has a lot more to offer, just read the doc! Please read the Change Log to get a picture of what's in. Please read the Breaking changes to get a picture of what's changed. Where Managing (Core) Project Current Upcoming Apizr Apizr.Extensions.Microsoft.DependencyInjection Caching Project Current Upcoming Apizr.Extensions.Microsoft.Caching Apizr.Integrations.Akavache Apizr.Integrations.MonkeyCache Handling Project Current Upcoming Apizr.Integrations.Fusillade Apizr.Integrations.MediatR Apizr.Integrations.Optional Mapping Project Current Upcoming Apizr.Integrations.AutoMapper Apizr.Integrations.Mapster Transferring Project Current Upcoming Apizr.Integrations.FileTransfer Apizr.Extensions.Microsoft.FileTransfer Apizr.Integrations.FileTransfer.MediatR Apizr.Integrations.FileTransfer.Optional Generating Project Current Upcoming Apizr.Tools.NSwag Install the NuGet reference package of your choice: Apizr package comes with the static builder 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 data mapping using AutoMapper Apizr.Integrations.Mapster package enables data mapping using Mapster Apizr.Integrations.FileTransfer package enables file transfer management for static registration Apizr.Extensions.Microsoft.FileTransfer package enables file transfer management for extended registration Apizr.Integrations.FileTransfer.MediatR package enables file transfer management for mediation requests (requires MediatR integration and could work with Optional integration) using MediatR Apizr.Integrations.FileTransfer.Optional package enables file transfer management for mediation requests with optional result (requires MediatR integration and could work with Optional integration) using Optional.Async Install the NuGet .NET CLI Tool package if needed: Apizr.Tools.NSwag package enables Apizr files generation by command lines (Models, Apis and Registrations) from an OpenApi/Swagger definition using NSwag Apizr core package make use of well known nuget packages to make the magic appear: Package Features 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) MapsterMappingHandler: Mapster mapping methods mapping interface (Integration package referenced above)" } } \ No newline at end of file diff --git a/nuget/Apizr.Extensions.Microsoft.Caching.nuspec b/nuget/Apizr.Extensions.Microsoft.Caching.nuspec index f79c9c58..9c014bf6 100644 --- a/nuget/Apizr.Extensions.Microsoft.Caching.nuspec +++ b/nuget/Apizr.Extensions.Microsoft.Caching.nuspec @@ -2,7 +2,7 @@ Apizr.Extensions.Microsoft.Caching - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Extensions.Microsoft.Caching Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Cache Web Api Extensions - + diff --git a/nuget/Apizr.Extensions.Microsoft.DependencyInjection.nuspec b/nuget/Apizr.Extensions.Microsoft.DependencyInjection.nuspec index 57a09050..0bb2faf6 100644 --- a/nuget/Apizr.Extensions.Microsoft.DependencyInjection.nuspec +++ b/nuget/Apizr.Extensions.Microsoft.DependencyInjection.nuspec @@ -2,7 +2,7 @@ Apizr.Extensions.Microsoft.DependencyInjection - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Extensions.Microsoft.DependencyInjection Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Polly Fusillade HttpTracer Web Api Extensions - + diff --git a/nuget/Apizr.Extensions.Microsoft.FileTransfer.nuspec b/nuget/Apizr.Extensions.Microsoft.FileTransfer.nuspec index b8710cfa..f4fafaa4 100644 --- a/nuget/Apizr.Extensions.Microsoft.FileTransfer.nuspec +++ b/nuget/Apizr.Extensions.Microsoft.FileTransfer.nuspec @@ -2,7 +2,7 @@ Apizr.Extensions.Microsoft.FileTransfer - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Extensions.Microsoft.FileTransfer Respawnsive Respawnsive @@ -15,8 +15,8 @@ https://www.apizr.net/changelog.html Refit Web Api Http File Transfer Download Upload - - + + diff --git a/nuget/Apizr.Integrations.Akavache.nuspec b/nuget/Apizr.Integrations.Akavache.nuspec index eeacc213..8104d069 100644 --- a/nuget/Apizr.Integrations.Akavache.nuspec +++ b/nuget/Apizr.Integrations.Akavache.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.Akavache - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Integrations.Akavache Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Polly Fusillade HttpTracer Web Api Akavache - + diff --git a/nuget/Apizr.Integrations.AutoMapper.nuspec b/nuget/Apizr.Integrations.AutoMapper.nuspec index ac8cb56d..b9847c0c 100644 --- a/nuget/Apizr.Integrations.AutoMapper.nuspec +++ b/nuget/Apizr.Integrations.AutoMapper.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.AutoMapper - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Integrations.AutoMapper Respawnsive Respawnsive @@ -17,19 +17,19 @@ - + - + - + - + diff --git a/nuget/Apizr.Integrations.FileTransfer.MediatR.nuspec b/nuget/Apizr.Integrations.FileTransfer.MediatR.nuspec index 31255fe0..806599f7 100644 --- a/nuget/Apizr.Integrations.FileTransfer.MediatR.nuspec +++ b/nuget/Apizr.Integrations.FileTransfer.MediatR.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.FileTransfer.MediatR - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Integrations.FileTransfer.MediatR Respawnsive Respawnsive @@ -15,8 +15,8 @@ https://www.apizr.net/changelog.html Refit Web Api Http Transfer - - + + diff --git a/nuget/Apizr.Integrations.FileTransfer.Optional.nuspec b/nuget/Apizr.Integrations.FileTransfer.Optional.nuspec index c3138258..a0bdaf51 100644 --- a/nuget/Apizr.Integrations.FileTransfer.Optional.nuspec +++ b/nuget/Apizr.Integrations.FileTransfer.Optional.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.FileTransfer.Optional - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Integrations.FileTransfer.Optional Respawnsive Respawnsive @@ -15,8 +15,8 @@ https://www.apizr.net/changelog.html Refit Web Api Http Transfer - - + + diff --git a/nuget/Apizr.Integrations.FileTransfer.nuspec b/nuget/Apizr.Integrations.FileTransfer.nuspec index c839e743..adc3ddd3 100644 --- a/nuget/Apizr.Integrations.FileTransfer.nuspec +++ b/nuget/Apizr.Integrations.FileTransfer.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.FileTransfer - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Integrations.FileTransfer Respawnsive Respawnsive @@ -15,7 +15,7 @@ https://www.apizr.net/changelog.html Refit Web Api Http Transfer - + diff --git a/nuget/Apizr.Integrations.Fusillade.nuspec b/nuget/Apizr.Integrations.Fusillade.nuspec index eddd7a4b..c5344647 100644 --- a/nuget/Apizr.Integrations.Fusillade.nuspec +++ b/nuget/Apizr.Integrations.Fusillade.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.Fusillade - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Integrations.Fusillade Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Fusillade Web Api Akavache - + diff --git a/nuget/Apizr.Integrations.Mapster.nuspec b/nuget/Apizr.Integrations.Mapster.nuspec index 328e6ea9..a9838d1c 100644 --- a/nuget/Apizr.Integrations.Mapster.nuspec +++ b/nuget/Apizr.Integrations.Mapster.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.Mapster - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Integrations.Mapster Respawnsive Respawnsive @@ -17,23 +17,23 @@ - + - + - + - + - + diff --git a/nuget/Apizr.Integrations.MediatR.nuspec b/nuget/Apizr.Integrations.MediatR.nuspec index 0b4b296d..39650394 100644 --- a/nuget/Apizr.Integrations.MediatR.nuspec +++ b/nuget/Apizr.Integrations.MediatR.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.MediatR - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Integrations.MediatR Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Web Api MediatR - + diff --git a/nuget/Apizr.Integrations.MonkeyCache.nuspec b/nuget/Apizr.Integrations.MonkeyCache.nuspec index 889b533f..5c902bb6 100644 --- a/nuget/Apizr.Integrations.MonkeyCache.nuspec +++ b/nuget/Apizr.Integrations.MonkeyCache.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.MonkeyCache - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Integrations.MonkeyCache Respawnsive Respawnsive @@ -17,23 +17,23 @@ - + - + - + - + - + diff --git a/nuget/Apizr.Integrations.Optional.nuspec b/nuget/Apizr.Integrations.Optional.nuspec index 4ca13fa5..2440adc6 100644 --- a/nuget/Apizr.Integrations.Optional.nuspec +++ b/nuget/Apizr.Integrations.Optional.nuspec @@ -2,7 +2,7 @@ Apizr.Integrations.Optional - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr.Integrations.Optional Respawnsive Respawnsive @@ -16,7 +16,7 @@ Refit Web Api Optional - + diff --git a/nuget/Apizr.Tools.NSwag.nuspec b/nuget/Apizr.Tools.NSwag.nuspec index b689d9ca..fb477fb7 100644 --- a/nuget/Apizr.Tools.NSwag.nuspec +++ b/nuget/Apizr.Tools.NSwag.nuspec @@ -2,7 +2,7 @@ Apizr.Tools.NSwag - 6.0.0-preview.5 + 6.0.0-preview.6 Respawnsive false @@ -13,7 +13,7 @@ - + diff --git a/nuget/Apizr.nuspec b/nuget/Apizr.nuspec index 33c3425b..e473e7db 100644 --- a/nuget/Apizr.nuspec +++ b/nuget/Apizr.nuspec @@ -2,7 +2,7 @@ Apizr - 6.0.0-preview.5 + 6.0.0-preview.6 Apizr Respawnsive Respawnsive diff --git a/nuget/readme.md b/nuget/readme.md index 09972d11..2dcabe27 100644 --- a/nuget/readme.md +++ b/nuget/readme.md @@ -2,7 +2,7 @@ Refit based web api client, but resilient (retry, connectivity, cache, auth, log, priority...) -[![Read - Documentation](https://img.shields.io/badge/read-documentation-blue?style=for-the-badge)](https://apizr.net/ "Go to project documentation") +[![Read - Documentation](https://img.shields.io/badge/read-documentation-blue?style=for-the-badge)](https://apizr.net/ "Go to project documentation") [![Browse - Source](https://img.shields.io/badge/browse-source_code-lightgrey?style=for-the-badge)](https://github.com/Respawnsive/Apizr "Go to project repository") ## What @@ -37,8 +37,6 @@ The list is not exhaustive, there’s more, but what we wanted was playing with Inspired by [Refit.Insane.PowerPack](https://github.com/thefex/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. - ## How An api definition with some attributes: @@ -48,18 +46,20 @@ An api definition with some attributes: namespace Apizr.Sample { // (Apizr) Define your web api base url and ask for cache and logs - [WebApi("https://reqres.in/"), Cache, Log] + [BaseAddress("https://reqres.in/"), + Cache(CacheMode.GetAndFetch, "01:00:00"), + Log(HttpMessageParts.AllButBodies)] public interface IReqResService { // (Refit) Define your web api interface methods [Get("/api/users")] - Task GetUsersAsync(); + Task GetUsersAsync([RequestOptions] IApizrRequestOptions options); [Get("/api/users/{userId}")] - Task GetUserAsync([CacheKey] int userId); + Task GetUserAsync([CacheKey] int userId, [RequestOptions] IApizrRequestOptions options); [Post("/api/users")] - Task CreateUser(User user); + Task CreateUser(User user, [RequestOptions] IApizrRequestOptions options); } } ``` @@ -116,7 +116,6 @@ var reqResManager = ApizrBuilder.Current.CreateManagerFor( Relies on `IServiceCollection` extension methods approach. ```csharp - // (Logger) Configure logging the way you want, like services.AddLogging(loggingBuilder => loggingBuilder.AddDebug()); @@ -138,7 +137,7 @@ var reqResManager = serviceProvider.GetRequiredService api.GetUsersAsync()); +var userList = await reqResManager.ExecuteAsync((api, opt) => api.GetUsersAsync(opt)); ``` This request will be managed with the defined resilience strategies, data cached and all logged. @@ -147,7 +146,8 @@ Apizr has a lot more to offer, just [read the doc](https://apizr.net)! ## Where -[Change Log](CHANGELOG.md) +- Please read the [Change Log](https://apizr.net/changelog.md) to get a picture of what's in. +- Please read the [Breaking changes](https://apizr.net/articles/breakingchanges.md) to get a picture of what's changed. ### Managing (Core)