Rystem.RepositoryFramework.Api.Client 6.1.0

dotnet add package Rystem.RepositoryFramework.Api.Client --version 6.1.0                
NuGet\Install-Package Rystem.RepositoryFramework.Api.Client -Version 6.1.0                
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.1.0" />                
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.1.0                
#r "nuget: Rystem.RepositoryFramework.Api.Client, 6.1.0"                
#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.1.0

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

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. 
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
6.1.0 7 9/29/2024
6.0.24 126 9/11/2024
6.0.23 325,046 7/18/2024
6.0.21 133 6/18/2024
6.0.20 727,737 6/16/2024
6.0.19 30,373 6/14/2024
6.0.18 120 6/14/2024
6.0.17 119 6/14/2024
6.0.16 49,962 6/10/2024
6.0.15 123 6/9/2024
6.0.14 94,257 5/24/2024
6.0.13 135 5/23/2024
6.0.12 112 5/23/2024
6.0.11 141 5/20/2024
6.0.9 146 5/20/2024
6.0.7 128 5/18/2024
6.0.6 102 5/10/2024
6.0.5 104 5/10/2024
6.0.4 549,768 4/3/2024
6.0.3 153 3/25/2024
6.0.2 393,442 3/11/2024
6.0.0 1,170,065 11/21/2023
6.0.0-rc.6 109 10/25/2023
6.0.0-rc.5 80 10/25/2023
6.0.0-rc.4 66 10/23/2023
6.0.0-rc.3 65 10/19/2023
6.0.0-rc.2 76 10/18/2023
6.0.0-rc.1 68 10/16/2023
5.0.20 638,692 9/25/2023
5.0.19 330 9/10/2023
5.0.18 288 9/6/2023
5.0.17 240 9/6/2023
5.0.16 256 9/5/2023
5.0.15 238 9/5/2023
5.0.14 236 9/5/2023
5.0.13 255 9/1/2023
5.0.12 235 8/31/2023
5.0.11 216 8/30/2023
5.0.10 245 8/29/2023
5.0.9 277 8/24/2023
5.0.8 265 8/24/2023
5.0.7 449,722 8/23/2023
5.0.6 17,568 8/21/2023
5.0.5 4,360 8/21/2023
5.0.4 190 8/16/2023
5.0.3 212,487 8/2/2023
5.0.2 1,779 8/2/2023
5.0.1 11,578 8/1/2023
5.0.0 11,864 7/31/2023
4.1.26 140,689 7/20/2023
4.1.25 24,663 7/16/2023
4.1.24 397,847 6/13/2023
4.1.23 45,714 6/13/2023
4.1.22 129,095 5/30/2023
4.1.21 55,450 5/20/2023
4.1.20 404,589 4/19/2023
4.1.19 95,299 3/20/2023
4.1.18 285 3/20/2023
4.1.17 293 3/16/2023
4.1.16 274 3/16/2023
4.1.15 284 3/15/2023
4.1.14 867 3/9/2023
4.1.13 301 3/7/2023
4.1.12 380 2/10/2023
4.1.11 352 1/26/2023
4.1.10 364 1/22/2023
4.1.9 339 1/20/2023
4.1.8 378 1/18/2023
4.1.7 489 1/18/2023
4.1.6 343 1/17/2023
4.1.1 367 1/4/2023
4.1.0 350 1/1/2023
3.1.5 350 12/21/2022
3.1.3 384 12/12/2022
3.1.2 336 12/7/2022
3.1.1 352 12/7/2022
3.1.0 410 12/2/2022
3.0.29 389 12/1/2022
3.0.28 385 12/1/2022
3.0.27 575 11/23/2022
3.0.25 379 11/23/2022
3.0.24 426 11/18/2022
3.0.23 394 11/18/2022
3.0.22 419 11/15/2022
3.0.21 411 11/14/2022
3.0.20 426 11/13/2022
3.0.19 595 11/2/2022
3.0.18 448 11/2/2022
3.0.17 441 10/29/2022
3.0.16 468 10/29/2022
3.0.15 448 10/29/2022
3.0.14 483 10/24/2022
3.0.13 459 10/24/2022
3.0.12 537 10/17/2022
3.0.11 493 10/10/2022
3.0.10 503 10/6/2022
3.0.9 461 10/6/2022
3.0.8 440 10/6/2022
3.0.7 473 10/6/2022
3.0.6 467 10/5/2022
3.0.5 455 10/5/2022
3.0.4 478 10/5/2022
3.0.3 522 10/3/2022
3.0.2 483 9/30/2022
3.0.1 468 9/29/2022
2.0.17 499 9/29/2022
2.0.16 485 9/27/2022
2.0.15 549 9/27/2022
2.0.14 563 9/26/2022
2.0.13 553 9/26/2022
2.0.12 512 9/26/2022
2.0.11 505 9/25/2022
2.0.10 533 9/25/2022
2.0.9 513 9/22/2022
2.0.8 494 9/22/2022
2.0.6 516 9/20/2022
2.0.5 534 9/20/2022
2.0.4 509 9/20/2022
2.0.2 484 9/20/2022
2.0.1 539 9/13/2022
2.0.0 497 8/19/2022
1.1.24 528 7/30/2022
1.1.23 518 7/29/2022
1.1.22 523 7/29/2022
1.1.21 779 7/29/2022
1.1.20 529 7/29/2022
1.1.19 560 7/27/2022
1.1.17 529 7/27/2022
1.1.16 548 7/26/2022
1.1.15 518 7/25/2022
1.1.14 557 7/25/2022
1.1.13 534 7/22/2022
1.1.12 523 7/19/2022
1.1.11 513 7/19/2022
1.1.10 517 7/19/2022
1.1.9 556 7/19/2022
1.1.8 548 7/18/2022
1.1.7 566 7/18/2022
1.1.6 507 7/18/2022
1.1.5 508 7/17/2022
1.1.4 544 7/17/2022
1.1.3 549 7/17/2022
1.1.2 548 7/17/2022
1.1.0 531 7/17/2022
1.0.2 516 7/15/2022
1.0.1 527 7/15/2022
1.0.0 525 7/8/2022
0.10.7 529 7/7/2022
0.10.2 566 7/2/2022
0.10.1 530 7/1/2022
0.10.0 550 7/1/2022
0.9.12 563 6/29/2022
0.9.11 583 6/21/2022
0.9.10 527 6/20/2022
0.9.9 507 6/11/2022
0.9.7 510 6/9/2022
0.9.6 512 6/5/2022
0.9.5 491 6/3/2022
0.9.3 479 6/3/2022
0.9.2 514 5/31/2022
0.9.1 533 5/31/2022
0.9.0 503 5/31/2022