Rystem.RepositoryFramework.Api.Client 6.0.4

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

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

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.0.4 73,432 4/3/2024
6.0.3 109 3/25/2024
6.0.2 393,396 3/11/2024
6.0.0 1,170,006 11/21/2023
6.0.0-rc.6 100 10/25/2023
6.0.0-rc.5 71 10/25/2023
6.0.0-rc.4 58 10/23/2023
6.0.0-rc.3 59 10/19/2023
6.0.0-rc.2 67 10/18/2023
6.0.0-rc.1 61 10/16/2023
5.0.20 638,647 9/25/2023
5.0.19 292 9/10/2023
5.0.18 255 9/6/2023
5.0.17 203 9/6/2023
5.0.16 219 9/5/2023
5.0.15 202 9/5/2023
5.0.14 202 9/5/2023
5.0.13 222 9/1/2023
5.0.12 199 8/31/2023
5.0.11 179 8/30/2023
5.0.10 209 8/29/2023
5.0.9 241 8/24/2023
5.0.8 230 8/24/2023
5.0.7 449,688 8/23/2023
5.0.6 17,543 8/21/2023
5.0.5 4,337 8/21/2023
5.0.4 170 8/16/2023
5.0.3 212,462 8/2/2023
5.0.2 1,751 8/2/2023
5.0.1 11,556 8/1/2023
5.0.0 11,836 7/31/2023
4.1.26 140,661 7/20/2023
4.1.25 24,642 7/16/2023
4.1.24 397,820 6/13/2023
4.1.23 45,692 6/13/2023
4.1.22 129,041 5/30/2023
4.1.21 55,426 5/20/2023
4.1.20 404,562 4/19/2023
4.1.19 95,277 3/20/2023
4.1.18 267 3/20/2023
4.1.17 266 3/16/2023
4.1.16 252 3/16/2023
4.1.15 255 3/15/2023
4.1.14 841 3/9/2023
4.1.13 279 3/7/2023
4.1.12 353 2/10/2023
4.1.11 325 1/26/2023
4.1.10 335 1/22/2023
4.1.9 313 1/20/2023
4.1.8 353 1/18/2023
4.1.7 469 1/18/2023
4.1.6 320 1/17/2023
4.1.1 339 1/4/2023
4.1.0 325 1/1/2023
3.1.5 324 12/21/2022
3.1.3 358 12/12/2022
3.1.2 315 12/7/2022
3.1.1 328 12/7/2022
3.1.0 385 12/2/2022
3.0.29 363 12/1/2022
3.0.28 360 12/1/2022
3.0.27 552 11/23/2022
3.0.25 356 11/23/2022
3.0.24 402 11/18/2022
3.0.23 371 11/18/2022
3.0.22 397 11/15/2022
3.0.21 391 11/14/2022
3.0.20 407 11/13/2022
3.0.19 574 11/2/2022
3.0.18 426 11/2/2022
3.0.17 417 10/29/2022
3.0.16 445 10/29/2022
3.0.15 426 10/29/2022
3.0.14 459 10/24/2022
3.0.13 437 10/24/2022
3.0.12 514 10/17/2022
3.0.11 472 10/10/2022
3.0.10 483 10/6/2022
3.0.9 435 10/6/2022
3.0.8 417 10/6/2022
3.0.7 446 10/6/2022
3.0.6 443 10/5/2022
3.0.5 435 10/5/2022
3.0.4 458 10/5/2022
3.0.3 499 10/3/2022
3.0.2 459 9/30/2022
3.0.1 440 9/29/2022
2.0.17 451 9/29/2022
2.0.16 463 9/27/2022
2.0.15 526 9/27/2022
2.0.14 539 9/26/2022
2.0.13 530 9/26/2022
2.0.12 489 9/26/2022
2.0.11 481 9/25/2022
2.0.10 511 9/25/2022
2.0.9 502 9/22/2022
2.0.8 471 9/22/2022
2.0.6 493 9/20/2022
2.0.5 525 9/20/2022
2.0.4 481 9/20/2022
2.0.2 460 9/20/2022
2.0.1 513 9/13/2022
2.0.0 475 8/19/2022
1.1.24 504 7/30/2022
1.1.23 494 7/29/2022
1.1.22 494 7/29/2022
1.1.21 754 7/29/2022
1.1.20 507 7/29/2022
1.1.19 529 7/27/2022
1.1.17 505 7/27/2022
1.1.16 526 7/26/2022
1.1.15 510 7/25/2022
1.1.14 535 7/25/2022
1.1.13 511 7/22/2022
1.1.12 497 7/19/2022
1.1.11 488 7/19/2022
1.1.10 506 7/19/2022
1.1.9 534 7/19/2022
1.1.8 539 7/18/2022
1.1.7 543 7/18/2022
1.1.6 497 7/18/2022
1.1.5 484 7/17/2022
1.1.4 520 7/17/2022
1.1.3 522 7/17/2022
1.1.2 521 7/17/2022
1.1.0 509 7/17/2022
1.0.2 492 7/15/2022
1.0.1 505 7/15/2022
1.0.0 516 7/8/2022
0.10.7 502 7/7/2022
0.10.2 544 7/2/2022
0.10.1 506 7/1/2022
0.10.0 526 7/1/2022
0.9.12 538 6/29/2022
0.9.11 561 6/21/2022
0.9.10 506 6/20/2022
0.9.9 473 6/11/2022
0.9.7 487 6/9/2022
0.9.6 484 6/5/2022
0.9.5 465 6/3/2022
0.9.3 459 6/3/2022
0.9.2 488 5/31/2022
0.9.1 506 5/31/2022
0.9.0 477 5/31/2022