Rystem.RepositoryFramework.Api.Client
2.0.16
See the version list below for details.
dotnet add package Rystem.RepositoryFramework.Api.Client --version 2.0.16
NuGet\Install-Package Rystem.RepositoryFramework.Api.Client -Version 2.0.16
<PackageReference Include="Rystem.RepositoryFramework.Api.Client" Version="2.0.16" />
paket add Rystem.RepositoryFramework.Api.Client --version 2.0.16
#r "nuget: Rystem.RepositoryFramework.Api.Client, 2.0.16"
// Install Rystem.RepositoryFramework.Api.Client as a Cake Addin #addin nuget:?package=Rystem.RepositoryFramework.Api.Client&version=2.0.16 // Install Rystem.RepositoryFramework.Api.Client as a Cake Tool #tool nuget:?package=Rystem.RepositoryFramework.Api.Client&version=2.0.16
What is Rystem?
Services extensions
You may add a repository client for your model. You may choose the domain (domain where the api is), and the custom path by default is "api", you may add custom configuration to the HttpClient and the service lifetime with singleton as default. The api url will be https://{domain}/{startingPath}/{ModelName}/{Type of Api (from Insert, Update, Delete, Batch, Get, Query, Exist, Operation)}
public static IRepositoryBuilder<T, TKey> AddRepositoryApiClient<T, TKey>(this IServiceCollection services,
string domain,
string startingPath = "api",
Action<HttpClient>? configureClient = null,
ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
where TKey : notnull
You have the same client for CQRS, with command
public static IRepositoryBuilder<T, TKey> AddCommandApiClient<T, TKey>(this IServiceCollection services,
string domain,
string startingPath = "api",
Action<HttpClient>? configureClient = null,
ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
where TKey : notnull
and query
public static IRepositoryBuilder<T, TKey> AddQueryApiClient<T, TKey>(this IServiceCollection services,
string domain,
string startingPath = "api",
Action<HttpClient>? configureClient = null,
ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
where TKey : notnull
HttpClient to use your API (example)
You can add a client for a specific url
services.AddRepositoryApiClient<User, string>("localhost:7058");
and use it in DI with
IRepository<User, string> repository
Query and Command
In DI you install the services
services.AddCommandApiClient<User, string>("localhost:7058");
services.AddQueryApiClient<User, string>("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.AddRepositoryApiClient<User, bool>("localhost:7058");
services.AddCommandApiClient<User, bool>("localhost:7058");
services.AddQueryApiClient<User, bool>("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 AddRepositoryApiClientInterceptor<TInterceptor>(this IServiceCollection services,
ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
where TInterceptor : class, IRepositoryClientInterceptor
or a specific interceptor for each model
public static RepositoryBuilder<T, TKey> AddApiClientSpecificInterceptor<T, TKey, TInterceptor>(this RepositoryBuilder<T, TKey> builder,
ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
where TInterceptor : class, IRepositoryClientInterceptor<T>
where TKey : notnull
or for a string as default TKey
public static RepositoryBuilder<T> AddApiClientSpecificInterceptor<T, TInterceptor>(this RepositoryBuilder<T> builder,
ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
where TInterceptor : class, IRepositoryClientInterceptor<T>
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.AddApiClientAuthorizationInterceptor();
This line of code inject an interceptor that works with ITokenAcquisition, injected by the framework during OpenId integration (for example AAD integration). Automatically it adds the token to each request.
You may use the default identity interceptor not on all repositories, you can specificy them with
builder.Services.AddApiClientSpecificAuthorizationInterceptor<T>();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
-
net6.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Http (>= 6.0.0)
- Microsoft.Identity.Web (>= 1.25.3)
- Rystem.RepositoryFramework.Abstractions (>= 2.0.16)
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 |
---|---|---|
9.0.0 | 28,600 | 11/16/2024 |
9.0.0-rc.1 | 80 | 10/18/2024 |
6.2.0 | 218,999 | 10/9/2024 |
6.1.1 | 119 | 10/9/2024 |
6.1.0 | 47,908 | 9/29/2024 |
6.0.24 | 148 | 9/11/2024 |
6.0.23 | 340,114 | 7/18/2024 |
6.0.21 | 139 | 6/18/2024 |
6.0.20 | 727,745 | 6/16/2024 |
6.0.19 | 30,379 | 6/14/2024 |
6.0.18 | 126 | 6/14/2024 |
6.0.17 | 129 | 6/14/2024 |
6.0.16 | 49,969 | 6/10/2024 |
6.0.15 | 130 | 6/9/2024 |
6.0.14 | 94,264 | 5/24/2024 |
6.0.13 | 143 | 5/23/2024 |
6.0.12 | 119 | 5/23/2024 |
6.0.11 | 148 | 5/20/2024 |
6.0.9 | 153 | 5/20/2024 |
6.0.7 | 136 | 5/18/2024 |
6.0.6 | 109 | 5/10/2024 |
6.0.5 | 112 | 5/10/2024 |
6.0.4 | 549,776 | 4/3/2024 |
6.0.3 | 164 | 3/25/2024 |
6.0.2 | 393,449 | 3/11/2024 |
6.0.0 | 1,170,073 | 11/21/2023 |
6.0.0-rc.6 | 118 | 10/25/2023 |
6.0.0-rc.5 | 89 | 10/25/2023 |
6.0.0-rc.4 | 74 | 10/23/2023 |
6.0.0-rc.3 | 74 | 10/19/2023 |
6.0.0-rc.2 | 84 | 10/18/2023 |
6.0.0-rc.1 | 76 | 10/16/2023 |
5.0.20 | 638,699 | 9/25/2023 |
5.0.19 | 336 | 9/10/2023 |
5.0.18 | 296 | 9/6/2023 |
5.0.17 | 249 | 9/6/2023 |
5.0.16 | 264 | 9/5/2023 |
5.0.15 | 244 | 9/5/2023 |
5.0.14 | 245 | 9/5/2023 |
5.0.13 | 263 | 9/1/2023 |
5.0.12 | 244 | 8/31/2023 |
5.0.11 | 226 | 8/30/2023 |
5.0.10 | 254 | 8/29/2023 |
5.0.9 | 286 | 8/24/2023 |
5.0.8 | 276 | 8/24/2023 |
5.0.7 | 449,732 | 8/23/2023 |
5.0.6 | 17,577 | 8/21/2023 |
5.0.5 | 4,366 | 8/21/2023 |
5.0.4 | 199 | 8/16/2023 |
5.0.3 | 212,495 | 8/2/2023 |
5.0.2 | 1,785 | 8/2/2023 |
5.0.1 | 11,586 | 8/1/2023 |
5.0.0 | 11,870 | 7/31/2023 |
4.1.26 | 140,705 | 7/20/2023 |
4.1.25 | 24,671 | 7/16/2023 |
4.1.24 | 397,854 | 6/13/2023 |
4.1.23 | 45,720 | 6/13/2023 |
4.1.22 | 129,103 | 5/30/2023 |
4.1.21 | 55,460 | 5/20/2023 |
4.1.20 | 404,597 | 4/19/2023 |
4.1.19 | 95,313 | 3/20/2023 |
4.1.18 | 296 | 3/20/2023 |
4.1.17 | 299 | 3/16/2023 |
4.1.16 | 283 | 3/16/2023 |
4.1.15 | 290 | 3/15/2023 |
4.1.14 | 873 | 3/9/2023 |
4.1.13 | 307 | 3/7/2023 |
4.1.12 | 386 | 2/10/2023 |
4.1.11 | 358 | 1/26/2023 |
4.1.10 | 371 | 1/22/2023 |
4.1.9 | 346 | 1/20/2023 |
4.1.8 | 385 | 1/18/2023 |
4.1.7 | 496 | 1/18/2023 |
4.1.6 | 350 | 1/17/2023 |
4.1.1 | 373 | 1/4/2023 |
4.1.0 | 356 | 1/1/2023 |
3.1.5 | 356 | 12/21/2022 |
3.1.3 | 391 | 12/12/2022 |
3.1.2 | 343 | 12/7/2022 |
3.1.1 | 359 | 12/7/2022 |
3.1.0 | 416 | 12/2/2022 |
3.0.29 | 395 | 12/1/2022 |
3.0.28 | 391 | 12/1/2022 |
3.0.27 | 582 | 11/23/2022 |
3.0.25 | 388 | 11/23/2022 |
3.0.24 | 432 | 11/18/2022 |
3.0.23 | 400 | 11/18/2022 |
3.0.22 | 427 | 11/15/2022 |
3.0.21 | 418 | 11/14/2022 |
3.0.20 | 433 | 11/13/2022 |
3.0.19 | 602 | 11/2/2022 |
3.0.18 | 454 | 11/2/2022 |
3.0.17 | 448 | 10/29/2022 |
3.0.16 | 474 | 10/29/2022 |
3.0.15 | 454 | 10/29/2022 |
3.0.14 | 489 | 10/24/2022 |
3.0.13 | 466 | 10/24/2022 |
3.0.12 | 543 | 10/17/2022 |
3.0.11 | 499 | 10/10/2022 |
3.0.10 | 510 | 10/6/2022 |
3.0.9 | 467 | 10/6/2022 |
3.0.8 | 447 | 10/6/2022 |
3.0.7 | 480 | 10/6/2022 |
3.0.6 | 474 | 10/5/2022 |
3.0.5 | 462 | 10/5/2022 |
3.0.4 | 484 | 10/5/2022 |
3.0.3 | 528 | 10/3/2022 |
3.0.2 | 489 | 9/30/2022 |
3.0.1 | 475 | 9/29/2022 |
2.0.17 | 506 | 9/29/2022 |
2.0.16 | 491 | 9/27/2022 |
2.0.15 | 555 | 9/27/2022 |
2.0.14 | 570 | 9/26/2022 |
2.0.13 | 560 | 9/26/2022 |
2.0.12 | 518 | 9/26/2022 |
2.0.11 | 511 | 9/25/2022 |
2.0.10 | 540 | 9/25/2022 |
2.0.9 | 519 | 9/22/2022 |
2.0.8 | 504 | 9/22/2022 |
2.0.6 | 522 | 9/20/2022 |
2.0.5 | 541 | 9/20/2022 |
2.0.4 | 515 | 9/20/2022 |
2.0.2 | 490 | 9/20/2022 |
2.0.1 | 547 | 9/13/2022 |
2.0.0 | 506 | 8/19/2022 |
1.1.24 | 534 | 7/30/2022 |
1.1.23 | 524 | 7/29/2022 |
1.1.22 | 530 | 7/29/2022 |
1.1.21 | 786 | 7/29/2022 |
1.1.20 | 539 | 7/29/2022 |
1.1.19 | 567 | 7/27/2022 |
1.1.17 | 535 | 7/27/2022 |
1.1.16 | 556 | 7/26/2022 |
1.1.15 | 527 | 7/25/2022 |
1.1.14 | 565 | 7/25/2022 |
1.1.13 | 542 | 7/22/2022 |
1.1.12 | 533 | 7/19/2022 |
1.1.11 | 519 | 7/19/2022 |
1.1.10 | 524 | 7/19/2022 |
1.1.9 | 562 | 7/19/2022 |
1.1.8 | 556 | 7/18/2022 |
1.1.7 | 572 | 7/18/2022 |
1.1.6 | 513 | 7/18/2022 |
1.1.5 | 514 | 7/17/2022 |
1.1.4 | 550 | 7/17/2022 |
1.1.3 | 557 | 7/17/2022 |
1.1.2 | 556 | 7/17/2022 |
1.1.0 | 539 | 7/17/2022 |
1.0.2 | 525 | 7/15/2022 |
1.0.1 | 535 | 7/15/2022 |
1.0.0 | 533 | 7/8/2022 |
0.10.7 | 535 | 7/7/2022 |
0.10.2 | 572 | 7/2/2022 |
0.10.1 | 537 | 7/1/2022 |
0.10.0 | 556 | 7/1/2022 |
0.9.12 | 571 | 6/29/2022 |
0.9.11 | 592 | 6/21/2022 |
0.9.10 | 536 | 6/20/2022 |
0.9.9 | 513 | 6/11/2022 |
0.9.7 | 520 | 6/9/2022 |
0.9.6 | 519 | 6/5/2022 |
0.9.5 | 497 | 6/3/2022 |
0.9.3 | 486 | 6/3/2022 |
0.9.2 | 520 | 5/31/2022 |
0.9.1 | 541 | 5/31/2022 |
0.9.0 | 510 | 5/31/2022 |