Rystem.RepositoryFramework.Api.Client 6.0.11

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rystem.RepositoryFramework.Api.Client --version 6.0.11                
NuGet\Install-Package Rystem.RepositoryFramework.Api.Client -Version 6.0.11                
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="6.0.11" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rystem.RepositoryFramework.Api.Client --version 6.0.11                
#r "nuget: Rystem.RepositoryFramework.Api.Client, 6.0.11"                
#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.
// Install Rystem.RepositoryFramework.Api.Client as a Cake Addin
#addin nuget:?package=Rystem.RepositoryFramework.Api.Client&version=6.0.11

// Install Rystem.RepositoryFramework.Api.Client as a Cake Tool
#tool nuget:?package=Rystem.RepositoryFramework.Api.Client&version=6.0.11                

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 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.  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. 
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.0.12 22,113 1/13/2025
9.0.11 23,044 1/9/2025
9.0.10 50 1/9/2025
9.0.9 155 1/7/2025
9.0.8 12,444 1/6/2025
9.0.7 82 1/6/2025
9.0.4 92,257 12/23/2024
9.0.3 101 12/22/2024
9.0.2 10,642 12/21/2024
9.0.1 1,143 12/21/2024
9.0.0 172,995 11/16/2024
9.0.0-rc.1 86 10/18/2024
6.2.0 219,015 10/9/2024
6.1.1 133 10/9/2024
6.1.0 47,924 9/29/2024
6.0.24 166 9/11/2024
6.0.23 340,130 7/18/2024
6.0.21 156 6/18/2024
6.0.20 727,762 6/16/2024
6.0.19 30,396 6/14/2024
6.0.18 141 6/14/2024
6.0.17 143 6/14/2024
6.0.16 49,983 6/10/2024
6.0.15 142 6/9/2024
6.0.14 94,276 5/24/2024
6.0.13 155 5/23/2024
6.0.12 131 5/23/2024
6.0.11 160 5/20/2024
6.0.9 185 5/20/2024
6.0.7 148 5/18/2024
6.0.6 121 5/10/2024
6.0.5 126 5/10/2024
6.0.4 549,786 4/3/2024
6.0.3 174 3/25/2024
6.0.2 393,459 3/11/2024
6.0.0 1,170,083 11/21/2023
6.0.0-rc.6 126 10/25/2023
6.0.0-rc.5 95 10/25/2023
6.0.0-rc.4 80 10/23/2023
6.0.0-rc.3 80 10/19/2023
6.0.0-rc.2 90 10/18/2023
6.0.0-rc.1 82 10/16/2023
5.0.20 638,709 9/25/2023
5.0.19 352 9/10/2023
5.0.18 306 9/6/2023
5.0.17 265 9/6/2023
5.0.16 274 9/5/2023
5.0.15 254 9/5/2023
5.0.14 274 9/5/2023
5.0.13 273 9/1/2023
5.0.12 254 8/31/2023
5.0.11 235 8/30/2023
5.0.10 263 8/29/2023
5.0.9 295 8/24/2023
5.0.8 290 8/24/2023
5.0.7 449,742 8/23/2023
5.0.6 17,586 8/21/2023
5.0.5 4,375 8/21/2023
5.0.4 209 8/16/2023
5.0.3 212,506 8/2/2023
5.0.2 1,794 8/2/2023
5.0.1 11,595 8/1/2023
5.0.0 11,880 7/31/2023
4.1.26 140,715 7/20/2023
4.1.25 24,680 7/16/2023
4.1.24 397,863 6/13/2023
4.1.23 45,729 6/13/2023
4.1.22 129,112 5/30/2023
4.1.21 55,471 5/20/2023
4.1.20 404,607 4/19/2023
4.1.19 95,321 3/20/2023
4.1.18 310 3/20/2023
4.1.17 307 3/16/2023
4.1.16 291 3/16/2023
4.1.15 303 3/15/2023
4.1.14 881 3/9/2023
4.1.13 317 3/7/2023
4.1.12 397 2/10/2023
4.1.11 372 1/26/2023
4.1.10 380 1/22/2023
4.1.9 358 1/20/2023
4.1.8 396 1/18/2023
4.1.7 507 1/18/2023
4.1.6 361 1/17/2023
4.1.1 390 1/4/2023
4.1.0 367 1/1/2023
3.1.5 365 12/21/2022
3.1.3 400 12/12/2022
3.1.2 356 12/7/2022
3.1.1 375 12/7/2022
3.1.0 429 12/2/2022
3.0.29 408 12/1/2022
3.0.28 402 12/1/2022
3.0.27 595 11/23/2022
3.0.25 401 11/23/2022
3.0.24 445 11/18/2022
3.0.23 414 11/18/2022
3.0.22 439 11/15/2022
3.0.21 431 11/14/2022
3.0.20 448 11/13/2022
3.0.19 615 11/2/2022
3.0.18 467 11/2/2022
3.0.17 459 10/29/2022
3.0.16 487 10/29/2022
3.0.15 467 10/29/2022
3.0.14 502 10/24/2022
3.0.13 490 10/24/2022
3.0.12 556 10/17/2022
3.0.11 514 10/10/2022
3.0.10 523 10/6/2022
3.0.9 480 10/6/2022
3.0.8 458 10/6/2022
3.0.7 491 10/6/2022
3.0.6 487 10/5/2022
3.0.5 474 10/5/2022
3.0.4 496 10/5/2022
3.0.3 539 10/3/2022
3.0.2 502 9/30/2022
3.0.1 493 9/29/2022
2.0.17 519 9/29/2022
2.0.16 504 9/27/2022
2.0.15 572 9/27/2022
2.0.14 583 9/26/2022
2.0.13 573 9/26/2022
2.0.12 531 9/26/2022
2.0.11 526 9/25/2022
2.0.10 551 9/25/2022
2.0.9 548 9/22/2022
2.0.8 515 9/22/2022
2.0.6 533 9/20/2022
2.0.5 569 9/20/2022
2.0.4 526 9/20/2022
2.0.2 501 9/20/2022
2.0.1 558 9/13/2022
2.0.0 519 8/19/2022
1.1.24 545 7/30/2022
1.1.23 535 7/29/2022
1.1.22 541 7/29/2022
1.1.21 806 7/29/2022
1.1.20 555 7/29/2022
1.1.19 579 7/27/2022
1.1.17 546 7/27/2022
1.1.16 567 7/26/2022
1.1.15 549 7/25/2022
1.1.14 577 7/25/2022
1.1.13 554 7/22/2022
1.1.12 549 7/19/2022
1.1.11 530 7/19/2022
1.1.10 548 7/19/2022
1.1.9 575 7/19/2022
1.1.8 581 7/18/2022
1.1.7 583 7/18/2022
1.1.6 542 7/18/2022
1.1.5 525 7/17/2022
1.1.4 561 7/17/2022
1.1.3 568 7/17/2022
1.1.2 567 7/17/2022
1.1.0 552 7/17/2022
1.0.2 542 7/15/2022
1.0.1 548 7/15/2022
1.0.0 566 7/8/2022
0.10.7 546 7/7/2022
0.10.2 583 7/2/2022
0.10.1 548 7/1/2022
0.10.0 567 7/1/2022
0.9.12 586 6/29/2022
0.9.11 603 6/21/2022
0.9.10 547 6/20/2022
0.9.9 524 6/11/2022
0.9.7 537 6/9/2022
0.9.6 530 6/5/2022
0.9.5 508 6/3/2022
0.9.3 499 6/3/2022
0.9.2 539 5/31/2022
0.9.1 552 5/31/2022
0.9.0 521 5/31/2022