Rystem.RepositoryFramework.Api.Client
6.0.21
dotnet add package Rystem.RepositoryFramework.Api.Client --version 6.0.21
NuGet\Install-Package Rystem.RepositoryFramework.Api.Client -Version 6.0.21
<PackageReference Include="Rystem.RepositoryFramework.Api.Client" Version="6.0.21" />
paket add Rystem.RepositoryFramework.Api.Client --version 6.0.21
#r "nuget: Rystem.RepositoryFramework.Api.Client, 6.0.21"
// Install Rystem.RepositoryFramework.Api.Client as a Cake Addin
#addin nuget:?package=Rystem.RepositoryFramework.Api.Client&version=6.0.21
// Install Rystem.RepositoryFramework.Api.Client as a Cake Tool
#tool nuget:?package=Rystem.RepositoryFramework.Api.Client&version=6.0.21
What is Rystem?
Services extensions
HttpClient to use your API (example)
You can add a client for a specific url
builder.Services.AddRepository<User, string>(builder =>
{
builder
.WithApiClient()
.WithHttpClient("localhost:7058");
});
You may add a Polly policy to your api client for example:
var retryPolicy = HttpPolicyExtensions
.HandleTransientHttpError()
.Or<TimeoutRejectedException>()
.RetryAsync(3);
builder.Services.AddRepository<User, string>(builder =>
{
builder
.WithApiClient()
.WithHttpClient("localhost:7058")
.ClientBuilder
.AddPolicyHandler(retryPolicy);
});
and use it in DI with
IRepository<User, string> repository
Query and Command
In DI you install the services
services.AddCommand<User, string>(builder => {
builder
.WithApiClient()
.WithHttpClient("localhost:7058");
});
services.AddQuery<User, string>(builder => {
builder
.WithApiClient()
.WithHttpClient("localhost:7058");
});
And you may inject the objects
Please, use ICommand, IQuery and not ICommandPattern, IQueryPattern
ICommand<User, string> command
IQuery<User, string> command
With a non default key
In DI you install the services with a bool key for example.
services.AddRepository<User, bool>(builder => {
builder
.WithApiClient()
.WithHttpClient("localhost:7058");
});
services.AddCommand<User, bool>(builder => {
builder
.WithApiClient()
.WithHttpClient("localhost:7058");
});
services.AddQuery<User, bool>(builder => {
builder
.WithApiClient()
.WithHttpClient("localhost:7058");
});
And you may inject the objects
Please, use ICommand, IQuery, IRepository and not ICommandPattern, IQueryPattern, IRepositoryPattern
IRepository<User, string> repository
ICommand<User, string> command
IQuery<User, string> command
Interceptors
You may add a custom interceptor for every request for every model
public static IServiceCollection AddApiClientInterceptor<TInterceptor>(this IServiceCollection services,
ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
where TInterceptor : class, IRepositoryClientInterceptor
or a specific interceptor for each model
public static IServiceCollection AddApiClientInterceptor<TInterceptor>(this IServiceCollection services,
ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
where TInterceptor : class, IRepositoryClientInterceptor
or for a string as default TKey
public static RepositorySettings<T, TKey> AddApiClientSpecificInterceptor<T, TKey, TInterceptor>(
this RepositorySettings<T, TKey> settings,
ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
where TInterceptor : class, IRepositoryClientInterceptor<T>
where TKey : notnull
Maybe you can use it to add a token as JWT o another pre-request things.
Default interceptor for Authentication with JWT
You may use the default interceptor to deal with the identity manager in .Net DI.
builder.Services.AddDefaultAuthorizationInterceptorForApiHttpClient();
with package
RepositoryFramework.Api.Client.Authentication.BlazorServer
or if you need to use in Wasm blazor use with
Rystem.RepositoryFramework.Api.Client.Authentication.BlazorWasm
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Http.Polly (>= 8.0.6)
- Polly (>= 8.4.0)
- Rystem.RepositoryFramework.Abstractions (>= 6.0.21)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Rystem.RepositoryFramework.Api.Client:
Package | Downloads |
---|---|
Rystem.RepositoryFramework.Api.Client.Authentication.BlazorServer
Rystem.RepositoryFramework allows you to use correctly concepts like repository pattern, CQRS and DDD. You have interfaces for your domains, auto-generated api, auto-generated HttpClient to simplify connection "api to front-end", a functionality for auto-population in memory of your models, a functionality to simulate exceptions and waiting time from external sources to improve your implementation/business test and load test. |
|
Rystem.RepositoryFramework.Api.Client.Authentication.BlazorWasm
Rystem.RepositoryFramework allows you to use correctly concepts like repository pattern, CQRS and DDD. You have interfaces for your domains, auto-generated api, auto-generated HttpClient to simplify connection "api to front-end", a functionality for auto-population in memory of your models, a functionality to simulate exceptions and waiting time from external sources to improve your implementation/business test and load test. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
6.0.21 | 87 | 6/18/2024 |
6.0.20 | 149,026 | 6/16/2024 |
6.0.19 | 30,332 | 6/14/2024 |
6.0.18 | 81 | 6/14/2024 |
6.0.17 | 76 | 6/14/2024 |
6.0.16 | 49,928 | 6/10/2024 |
6.0.15 | 82 | 6/9/2024 |
6.0.14 | 94,217 | 5/24/2024 |
6.0.13 | 102 | 5/23/2024 |
6.0.12 | 76 | 5/23/2024 |
6.0.11 | 104 | 5/20/2024 |
6.0.9 | 108 | 5/20/2024 |
6.0.7 | 98 | 5/18/2024 |
6.0.6 | 69 | 5/10/2024 |
6.0.5 | 79 | 5/10/2024 |
6.0.4 | 549,743 | 4/3/2024 |
6.0.3 | 121 | 3/25/2024 |
6.0.2 | 393,401 | 3/11/2024 |
6.0.0 | 1,170,025 | 11/21/2023 |
6.0.0-rc.6 | 102 | 10/25/2023 |
6.0.0-rc.5 | 72 | 10/25/2023 |
6.0.0-rc.4 | 59 | 10/23/2023 |
6.0.0-rc.3 | 60 | 10/19/2023 |
6.0.0-rc.2 | 68 | 10/18/2023 |
6.0.0-rc.1 | 62 | 10/16/2023 |
5.0.20 | 638,654 | 9/25/2023 |
5.0.19 | 296 | 9/10/2023 |
5.0.18 | 259 | 9/6/2023 |
5.0.17 | 207 | 9/6/2023 |
5.0.16 | 223 | 9/5/2023 |
5.0.15 | 206 | 9/5/2023 |
5.0.14 | 206 | 9/5/2023 |
5.0.13 | 226 | 9/1/2023 |
5.0.12 | 204 | 8/31/2023 |
5.0.11 | 183 | 8/30/2023 |
5.0.10 | 213 | 8/29/2023 |
5.0.9 | 245 | 8/24/2023 |
5.0.8 | 234 | 8/24/2023 |
5.0.7 | 449,692 | 8/23/2023 |
5.0.6 | 17,547 | 8/21/2023 |
5.0.5 | 4,341 | 8/21/2023 |
5.0.4 | 174 | 8/16/2023 |
5.0.3 | 212,467 | 8/2/2023 |
5.0.2 | 1,755 | 8/2/2023 |
5.0.1 | 11,560 | 8/1/2023 |
5.0.0 | 11,841 | 7/31/2023 |
4.1.26 | 140,666 | 7/20/2023 |
4.1.25 | 24,646 | 7/16/2023 |
4.1.24 | 397,825 | 6/13/2023 |
4.1.23 | 45,696 | 6/13/2023 |
4.1.22 | 129,064 | 5/30/2023 |
4.1.21 | 55,430 | 5/20/2023 |
4.1.20 | 404,569 | 4/19/2023 |
4.1.19 | 95,282 | 3/20/2023 |
4.1.18 | 271 | 3/20/2023 |
4.1.17 | 270 | 3/16/2023 |
4.1.16 | 256 | 3/16/2023 |
4.1.15 | 259 | 3/15/2023 |
4.1.14 | 845 | 3/9/2023 |
4.1.13 | 283 | 3/7/2023 |
4.1.12 | 358 | 2/10/2023 |
4.1.11 | 332 | 1/26/2023 |
4.1.10 | 341 | 1/22/2023 |
4.1.9 | 319 | 1/20/2023 |
4.1.8 | 359 | 1/18/2023 |
4.1.7 | 473 | 1/18/2023 |
4.1.6 | 324 | 1/17/2023 |
4.1.1 | 345 | 1/4/2023 |
4.1.0 | 331 | 1/1/2023 |
3.1.5 | 329 | 12/21/2022 |
3.1.3 | 364 | 12/12/2022 |
3.1.2 | 319 | 12/7/2022 |
3.1.1 | 332 | 12/7/2022 |
3.1.0 | 389 | 12/2/2022 |
3.0.29 | 369 | 12/1/2022 |
3.0.28 | 364 | 12/1/2022 |
3.0.27 | 557 | 11/23/2022 |
3.0.25 | 360 | 11/23/2022 |
3.0.24 | 406 | 11/18/2022 |
3.0.23 | 375 | 11/18/2022 |
3.0.22 | 399 | 11/15/2022 |
3.0.21 | 393 | 11/14/2022 |
3.0.20 | 409 | 11/13/2022 |
3.0.19 | 578 | 11/2/2022 |
3.0.18 | 428 | 11/2/2022 |
3.0.17 | 422 | 10/29/2022 |
3.0.16 | 447 | 10/29/2022 |
3.0.15 | 430 | 10/29/2022 |
3.0.14 | 463 | 10/24/2022 |
3.0.13 | 441 | 10/24/2022 |
3.0.12 | 518 | 10/17/2022 |
3.0.11 | 476 | 10/10/2022 |
3.0.10 | 485 | 10/6/2022 |
3.0.9 | 439 | 10/6/2022 |
3.0.8 | 421 | 10/6/2022 |
3.0.7 | 450 | 10/6/2022 |
3.0.6 | 447 | 10/5/2022 |
3.0.5 | 437 | 10/5/2022 |
3.0.4 | 460 | 10/5/2022 |
3.0.3 | 503 | 10/3/2022 |
3.0.2 | 463 | 9/30/2022 |
3.0.1 | 442 | 9/29/2022 |
2.0.17 | 454 | 9/29/2022 |
2.0.16 | 467 | 9/27/2022 |
2.0.15 | 528 | 9/27/2022 |
2.0.14 | 545 | 9/26/2022 |
2.0.13 | 534 | 9/26/2022 |
2.0.12 | 493 | 9/26/2022 |
2.0.11 | 485 | 9/25/2022 |
2.0.10 | 515 | 9/25/2022 |
2.0.9 | 506 | 9/22/2022 |
2.0.8 | 473 | 9/22/2022 |
2.0.6 | 495 | 9/20/2022 |
2.0.5 | 527 | 9/20/2022 |
2.0.4 | 483 | 9/20/2022 |
2.0.2 | 462 | 9/20/2022 |
2.0.1 | 519 | 9/13/2022 |
2.0.0 | 478 | 8/19/2022 |
1.1.24 | 507 | 7/30/2022 |
1.1.23 | 496 | 7/29/2022 |
1.1.22 | 496 | 7/29/2022 |
1.1.21 | 758 | 7/29/2022 |
1.1.20 | 509 | 7/29/2022 |
1.1.19 | 531 | 7/27/2022 |
1.1.17 | 507 | 7/27/2022 |
1.1.16 | 528 | 7/26/2022 |
1.1.15 | 512 | 7/25/2022 |
1.1.14 | 537 | 7/25/2022 |
1.1.13 | 513 | 7/22/2022 |
1.1.12 | 499 | 7/19/2022 |
1.1.11 | 490 | 7/19/2022 |
1.1.10 | 508 | 7/19/2022 |
1.1.9 | 536 | 7/19/2022 |
1.1.8 | 541 | 7/18/2022 |
1.1.7 | 545 | 7/18/2022 |
1.1.6 | 499 | 7/18/2022 |
1.1.5 | 486 | 7/17/2022 |
1.1.4 | 522 | 7/17/2022 |
1.1.3 | 524 | 7/17/2022 |
1.1.2 | 524 | 7/17/2022 |
1.1.0 | 512 | 7/17/2022 |
1.0.2 | 495 | 7/15/2022 |
1.0.1 | 507 | 7/15/2022 |
1.0.0 | 518 | 7/8/2022 |
0.10.7 | 505 | 7/7/2022 |
0.10.2 | 546 | 7/2/2022 |
0.10.1 | 508 | 7/1/2022 |
0.10.0 | 528 | 7/1/2022 |
0.9.12 | 541 | 6/29/2022 |
0.9.11 | 565 | 6/21/2022 |
0.9.10 | 508 | 6/20/2022 |
0.9.9 | 475 | 6/11/2022 |
0.9.7 | 489 | 6/9/2022 |
0.9.6 | 486 | 6/5/2022 |
0.9.5 | 467 | 6/3/2022 |
0.9.3 | 461 | 6/3/2022 |
0.9.2 | 491 | 5/31/2022 |
0.9.1 | 508 | 5/31/2022 |
0.9.0 | 479 | 5/31/2022 |