Rystem.RepositoryFramework.Api.Client 3.0.13

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rystem.RepositoryFramework.Api.Client --version 3.0.13
                    
NuGet\Install-Package Rystem.RepositoryFramework.Api.Client -Version 3.0.13
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rystem.RepositoryFramework.Api.Client" Version="3.0.13" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rystem.RepositoryFramework.Api.Client" Version="3.0.13" />
                    
Directory.Packages.props
<PackageReference Include="Rystem.RepositoryFramework.Api.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rystem.RepositoryFramework.Api.Client --version 3.0.13
                    
#r "nuget: Rystem.RepositoryFramework.Api.Client, 3.0.13"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rystem.RepositoryFramework.Api.Client@3.0.13
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rystem.RepositoryFramework.Api.Client&version=3.0.13
                    
Install as a Cake Addin
#tool nuget:?package=Rystem.RepositoryFramework.Api.Client&version=3.0.13
                    
Install as a Cake Tool

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,
    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,
    ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
    where TKey : notnull

and query

  public static IRepositoryBuilder<T, TKey> AddQueryApiClient<T, TKey>(this IServiceCollection services,
    ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
    where TKey : notnull

HttpClient to use your API (example)

You can add a client for a specific url

 .AddRepositoryApiClient<User, string>(serviceLifetime: ServiceLifetime.Scoped)
    .WithHttpClient("localhost:7058")
    .WithVersion("v2")
    .WithStartingPath("api");

You may add a Polly policy to your api client for example:

var retryPolicy = HttpPolicyExtensions
  .HandleTransientHttpError()
  .Or<TimeoutRejectedException>()
  .RetryAsync(3);

builder.Services
    .AddRepositoryApiClient<User, string>(serviceLifetime: ServiceLifetime.Scoped)
    .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.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 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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1.3 250 9/2/2025
9.1.2 608,073 5/29/2025
9.1.1 97,826 5/2/2025
9.0.32 186,628 4/15/2025
9.0.31 5,847 4/2/2025
9.0.30 88,831 3/26/2025
9.0.29 9,038 3/18/2025
9.0.28 226 3/17/2025
9.0.27 215 3/16/2025
9.0.26 250 3/13/2025
9.0.25 52,117 3/9/2025
9.0.21 369 3/6/2025
9.0.20 19,594 3/6/2025
9.0.19 299 3/6/2025
9.0.18 312 3/4/2025
9.0.17 188 3/1/2025
9.0.16 194 3/1/2025
9.0.15 75,551 2/22/2025
9.0.14 22,579 2/18/2025
9.0.13 216 2/9/2025
9.0.12 217,687 1/13/2025
9.0.11 24,055 1/9/2025
9.0.10 185 1/9/2025
9.0.9 4,049 1/7/2025
9.0.8 12,549 1/6/2025
9.0.7 182 1/6/2025
9.0.4 92,341 12/23/2024
9.0.3 200 12/22/2024
9.0.2 10,728 12/21/2024
9.0.1 1,232 12/21/2024
9.0.0 173,096 11/16/2024
9.0.0-rc.1 127 10/18/2024
6.2.0 219,110 10/9/2024
6.1.1 228 10/9/2024
6.1.0 48,014 9/29/2024
6.0.24 245 9/11/2024
6.0.23 340,215 7/18/2024
6.0.21 241 6/18/2024
6.0.20 727,857 6/16/2024
6.0.19 30,500 6/14/2024
6.0.18 242 6/14/2024
6.0.17 221 6/14/2024
6.0.16 50,085 6/10/2024
6.0.15 219 6/9/2024
6.0.14 94,367 5/24/2024
6.0.13 234 5/23/2024
6.0.12 227 5/23/2024
6.0.11 249 5/20/2024
6.0.9 256 5/20/2024
6.0.7 244 5/18/2024
6.0.6 200 5/10/2024
6.0.5 219 5/10/2024
6.0.4 549,889 4/3/2024
6.0.3 274 3/25/2024
6.0.2 393,569 3/11/2024
6.0.0 1,170,138 11/21/2023
6.0.0-rc.6 174 10/25/2023
6.0.0-rc.5 115 10/25/2023
6.0.0-rc.4 123 10/23/2023
6.0.0-rc.3 126 10/19/2023
6.0.0-rc.2 113 10/18/2023
6.0.0-rc.1 107 10/16/2023
5.0.20 638,800 9/25/2023
5.0.19 433 9/10/2023
5.0.18 391 9/6/2023
5.0.17 360 9/6/2023
5.0.16 358 9/5/2023
5.0.15 354 9/5/2023
5.0.14 363 9/5/2023
5.0.13 368 9/1/2023
5.0.12 353 8/31/2023
5.0.11 330 8/30/2023
5.0.10 346 8/29/2023
5.0.9 392 8/24/2023
5.0.8 388 8/24/2023
5.0.7 449,832 8/23/2023
5.0.6 17,648 8/21/2023
5.0.5 4,436 8/21/2023
5.0.4 296 8/16/2023
5.0.3 212,588 8/2/2023
5.0.2 1,858 8/2/2023
5.0.1 11,665 8/1/2023
5.0.0 11,968 7/31/2023
4.1.26 140,797 7/20/2023
4.1.25 24,759 7/16/2023
4.1.24 397,958 6/13/2023
4.1.23 45,826 6/13/2023
4.1.22 129,223 5/30/2023
4.1.21 55,548 5/20/2023
4.1.20 404,696 4/19/2023
4.1.19 95,421 3/20/2023
4.1.18 407 3/20/2023
4.1.17 407 3/16/2023
4.1.16 373 3/16/2023
4.1.15 404 3/15/2023
4.1.14 983 3/9/2023
4.1.13 399 3/7/2023
4.1.12 530 2/10/2023
4.1.11 480 1/26/2023
4.1.10 498 1/22/2023
4.1.9 443 1/20/2023
4.1.8 479 1/18/2023
4.1.7 591 1/18/2023
4.1.6 457 1/17/2023
4.1.1 487 1/4/2023
4.1.0 466 1/1/2023
3.1.5 465 12/21/2022
3.1.3 516 12/12/2022
3.1.2 439 12/7/2022
3.1.1 455 12/7/2022
3.1.0 541 12/2/2022
3.0.29 498 12/1/2022
3.0.28 489 12/1/2022
3.0.27 682 11/23/2022
3.0.25 483 11/23/2022
3.0.24 544 11/18/2022
3.0.23 516 11/18/2022
3.0.22 523 11/15/2022
3.0.21 533 11/14/2022
3.0.20 546 11/13/2022
3.0.19 724 11/2/2022
3.0.18 552 11/2/2022
3.0.17 560 10/29/2022
3.0.16 572 10/29/2022
3.0.15 566 10/29/2022
3.0.14 591 10/24/2022
3.0.13 609 10/24/2022
3.0.12 662 10/17/2022
3.0.11 601 10/10/2022
3.0.10 627 10/6/2022
3.0.9 581 10/6/2022
3.0.8 559 10/6/2022
3.0.7 580 10/6/2022
3.0.6 584 10/5/2022
3.0.5 561 10/5/2022
3.0.4 585 10/5/2022
3.0.3 653 10/3/2022
3.0.2 600 9/30/2022
3.0.1 606 9/29/2022
2.0.17 629 9/29/2022
2.0.16 594 9/27/2022
2.0.15 665 9/27/2022
2.0.14 685 9/26/2022
2.0.13 660 9/26/2022
2.0.12 645 9/26/2022
2.0.11 622 9/25/2022
2.0.10 662 9/25/2022
2.0.9 655 9/22/2022
2.0.8 616 9/22/2022
2.0.6 636 9/20/2022
2.0.5 658 9/20/2022
2.0.4 617 9/20/2022
2.0.2 610 9/20/2022
2.0.1 650 9/13/2022
2.0.0 628 8/19/2022
1.1.24 672 7/30/2022
1.1.23 627 7/29/2022
1.1.22 646 7/29/2022
1.1.21 898 7/29/2022
1.1.20 669 7/29/2022
1.1.19 682 7/27/2022
1.1.17 655 7/27/2022
1.1.16 682 7/26/2022
1.1.15 648 7/25/2022
1.1.14 669 7/25/2022
1.1.13 670 7/22/2022
1.1.12 643 7/19/2022
1.1.11 644 7/19/2022
1.1.10 641 7/19/2022
1.1.9 668 7/19/2022
1.1.8 685 7/18/2022
1.1.7 690 7/18/2022
1.1.6 658 7/18/2022
1.1.5 625 7/17/2022
1.1.4 658 7/17/2022
1.1.3 687 7/17/2022
1.1.2 689 7/17/2022
1.1.0 668 7/17/2022
1.0.2 636 7/15/2022
1.0.1 644 7/15/2022
1.0.0 685 7/8/2022
0.10.7 649 7/7/2022
0.10.2 676 7/2/2022
0.10.1 651 7/1/2022
0.10.0 660 7/1/2022
0.9.12 702 6/29/2022
0.9.11 698 6/21/2022
0.9.10 662 6/20/2022
0.9.9 638 6/11/2022
0.9.7 653 6/9/2022
0.9.6 627 6/5/2022
0.9.5 620 6/3/2022
0.9.3 610 6/3/2022
0.9.2 656 5/31/2022
0.9.1 639 5/31/2022
0.9.0 634 5/31/2022