Rystem.RepositoryFramework.Api.Client 6.0.7

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.7
NuGet\Install-Package Rystem.RepositoryFramework.Api.Client -Version 6.0.7
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.7" />
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.7
#r "nuget: Rystem.RepositoryFramework.Api.Client, 6.0.7"
#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.7

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

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.19 16,561 6/14/2024
6.0.18 42 6/14/2024
6.0.17 38 6/14/2024
6.0.16 49,924 6/10/2024
6.0.15 77 6/9/2024
6.0.14 94,215 5/24/2024
6.0.13 100 5/23/2024
6.0.12 74 5/23/2024
6.0.11 102 5/20/2024
6.0.9 107 5/20/2024
6.0.7 97 5/18/2024
6.0.6 68 5/10/2024
6.0.5 78 5/10/2024
6.0.4 549,742 4/3/2024
6.0.3 116 3/25/2024
6.0.2 393,400 3/11/2024
6.0.0 1,170,024 11/21/2023
6.0.0-rc.6 101 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,653 9/25/2023
5.0.19 295 9/10/2023
5.0.18 258 9/6/2023
5.0.17 206 9/6/2023
5.0.16 222 9/5/2023
5.0.15 205 9/5/2023
5.0.14 205 9/5/2023
5.0.13 225 9/1/2023
5.0.12 203 8/31/2023
5.0.11 182 8/30/2023
5.0.10 212 8/29/2023
5.0.9 244 8/24/2023
5.0.8 233 8/24/2023
5.0.7 449,691 8/23/2023
5.0.6 17,546 8/21/2023
5.0.5 4,340 8/21/2023
5.0.4 173 8/16/2023
5.0.3 212,466 8/2/2023
5.0.2 1,754 8/2/2023
5.0.1 11,559 8/1/2023
5.0.0 11,840 7/31/2023
4.1.26 140,665 7/20/2023
4.1.25 24,645 7/16/2023
4.1.24 397,824 6/13/2023
4.1.23 45,695 6/13/2023
4.1.22 129,062 5/30/2023
4.1.21 55,429 5/20/2023
4.1.20 404,568 4/19/2023
4.1.19 95,281 3/20/2023
4.1.18 270 3/20/2023
4.1.17 269 3/16/2023
4.1.16 255 3/16/2023
4.1.15 258 3/15/2023
4.1.14 844 3/9/2023
4.1.13 282 3/7/2023
4.1.12 357 2/10/2023
4.1.11 331 1/26/2023
4.1.10 340 1/22/2023
4.1.9 318 1/20/2023
4.1.8 358 1/18/2023
4.1.7 472 1/18/2023
4.1.6 323 1/17/2023
4.1.1 344 1/4/2023
4.1.0 330 1/1/2023
3.1.5 328 12/21/2022
3.1.3 363 12/12/2022
3.1.2 318 12/7/2022
3.1.1 331 12/7/2022
3.1.0 388 12/2/2022
3.0.29 368 12/1/2022
3.0.28 363 12/1/2022
3.0.27 556 11/23/2022
3.0.25 359 11/23/2022
3.0.24 405 11/18/2022
3.0.23 374 11/18/2022
3.0.22 398 11/15/2022
3.0.21 392 11/14/2022
3.0.20 408 11/13/2022
3.0.19 577 11/2/2022
3.0.18 427 11/2/2022
3.0.17 419 10/29/2022
3.0.16 446 10/29/2022
3.0.15 427 10/29/2022
3.0.14 460 10/24/2022
3.0.13 438 10/24/2022
3.0.12 517 10/17/2022
3.0.11 475 10/10/2022
3.0.10 484 10/6/2022
3.0.9 438 10/6/2022
3.0.8 420 10/6/2022
3.0.7 449 10/6/2022
3.0.6 446 10/5/2022
3.0.5 436 10/5/2022
3.0.4 459 10/5/2022
3.0.3 502 10/3/2022
3.0.2 462 9/30/2022
3.0.1 441 9/29/2022
2.0.17 453 9/29/2022
2.0.16 466 9/27/2022
2.0.15 527 9/27/2022
2.0.14 544 9/26/2022
2.0.13 533 9/26/2022
2.0.12 492 9/26/2022
2.0.11 484 9/25/2022
2.0.10 514 9/25/2022
2.0.9 505 9/22/2022
2.0.8 472 9/22/2022
2.0.6 494 9/20/2022
2.0.5 526 9/20/2022
2.0.4 482 9/20/2022
2.0.2 461 9/20/2022
2.0.1 516 9/13/2022
2.0.0 477 8/19/2022
1.1.24 506 7/30/2022
1.1.23 495 7/29/2022
1.1.22 495 7/29/2022
1.1.21 757 7/29/2022
1.1.20 508 7/29/2022
1.1.19 530 7/27/2022
1.1.17 506 7/27/2022
1.1.16 527 7/26/2022
1.1.15 511 7/25/2022
1.1.14 536 7/25/2022
1.1.13 512 7/22/2022
1.1.12 498 7/19/2022
1.1.11 489 7/19/2022
1.1.10 507 7/19/2022
1.1.9 535 7/19/2022
1.1.8 540 7/18/2022
1.1.7 544 7/18/2022
1.1.6 498 7/18/2022
1.1.5 485 7/17/2022
1.1.4 521 7/17/2022
1.1.3 523 7/17/2022
1.1.2 523 7/17/2022
1.1.0 511 7/17/2022
1.0.2 494 7/15/2022
1.0.1 506 7/15/2022
1.0.0 517 7/8/2022
0.10.7 504 7/7/2022
0.10.2 545 7/2/2022
0.10.1 507 7/1/2022
0.10.0 527 7/1/2022
0.9.12 540 6/29/2022
0.9.11 564 6/21/2022
0.9.10 507 6/20/2022
0.9.9 474 6/11/2022
0.9.7 488 6/9/2022
0.9.6 485 6/5/2022
0.9.5 466 6/3/2022
0.9.3 460 6/3/2022
0.9.2 490 5/31/2022
0.9.1 507 5/31/2022
0.9.0 478 5/31/2022