Rystem.RepositoryFramework.Api.Client 9.0.0-rc.1

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

// Install Rystem.RepositoryFramework.Api.Client as a Cake Tool
#tool nuget:?package=Rystem.RepositoryFramework.Api.Client&version=9.0.0-rc.1&prerelease                

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 net9.0 is compatible. 
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.4 66,334 12/23/2024
9.0.3 96 12/22/2024
9.0.2 10,635 12/21/2024
9.0.1 1,138 12/21/2024
9.0.0 172,991 11/16/2024
9.0.0-rc.1 85 10/18/2024
6.2.0 219,012 10/9/2024
6.1.1 130 10/9/2024
6.1.0 47,923 9/29/2024
6.0.24 161 9/11/2024
6.0.23 340,126 7/18/2024
6.0.21 154 6/18/2024
6.0.20 727,760 6/16/2024
6.0.19 30,392 6/14/2024
6.0.18 139 6/14/2024
6.0.17 139 6/14/2024
6.0.16 49,981 6/10/2024
6.0.15 140 6/9/2024
6.0.14 94,274 5/24/2024
6.0.13 153 5/23/2024
6.0.12 129 5/23/2024
6.0.11 158 5/20/2024
6.0.9 163 5/20/2024
6.0.7 146 5/18/2024
6.0.6 119 5/10/2024
6.0.5 124 5/10/2024
6.0.4 549,784 4/3/2024
6.0.3 172 3/25/2024
6.0.2 393,457 3/11/2024
6.0.0 1,170,081 11/21/2023
6.0.0-rc.6 124 10/25/2023
6.0.0-rc.5 93 10/25/2023
6.0.0-rc.4 78 10/23/2023
6.0.0-rc.3 78 10/19/2023
6.0.0-rc.2 88 10/18/2023
6.0.0-rc.1 80 10/16/2023
5.0.20 638,707 9/25/2023
5.0.19 350 9/10/2023
5.0.18 304 9/6/2023
5.0.17 263 9/6/2023
5.0.16 272 9/5/2023
5.0.15 252 9/5/2023
5.0.14 253 9/5/2023
5.0.13 271 9/1/2023
5.0.12 252 8/31/2023
5.0.11 233 8/30/2023
5.0.10 261 8/29/2023
5.0.9 293 8/24/2023
5.0.8 288 8/24/2023
5.0.7 449,740 8/23/2023
5.0.6 17,584 8/21/2023
5.0.5 4,373 8/21/2023
5.0.4 207 8/16/2023
5.0.3 212,503 8/2/2023
5.0.2 1,792 8/2/2023
5.0.1 11,593 8/1/2023
5.0.0 11,878 7/31/2023
4.1.26 140,713 7/20/2023
4.1.25 24,678 7/16/2023
4.1.24 397,861 6/13/2023
4.1.23 45,727 6/13/2023
4.1.22 129,110 5/30/2023
4.1.21 55,469 5/20/2023
4.1.20 404,605 4/19/2023
4.1.19 95,320 3/20/2023
4.1.18 309 3/20/2023
4.1.17 306 3/16/2023
4.1.16 290 3/16/2023
4.1.15 302 3/15/2023
4.1.14 880 3/9/2023
4.1.13 316 3/7/2023
4.1.12 395 2/10/2023
4.1.11 368 1/26/2023
4.1.10 378 1/22/2023
4.1.9 354 1/20/2023
4.1.8 392 1/18/2023
4.1.7 503 1/18/2023
4.1.6 359 1/17/2023
4.1.1 386 1/4/2023
4.1.0 365 1/1/2023
3.1.5 363 12/21/2022
3.1.3 398 12/12/2022
3.1.2 354 12/7/2022
3.1.1 373 12/7/2022
3.1.0 427 12/2/2022
3.0.29 406 12/1/2022
3.0.28 400 12/1/2022
3.0.27 591 11/23/2022
3.0.25 399 11/23/2022
3.0.24 441 11/18/2022
3.0.23 410 11/18/2022
3.0.22 437 11/15/2022
3.0.21 427 11/14/2022
3.0.20 446 11/13/2022
3.0.19 613 11/2/2022
3.0.18 463 11/2/2022
3.0.17 457 10/29/2022
3.0.16 483 10/29/2022
3.0.15 465 10/29/2022
3.0.14 498 10/24/2022
3.0.13 477 10/24/2022
3.0.12 554 10/17/2022
3.0.11 512 10/10/2022
3.0.10 519 10/6/2022
3.0.9 476 10/6/2022
3.0.8 456 10/6/2022
3.0.7 489 10/6/2022
3.0.6 483 10/5/2022
3.0.5 472 10/5/2022
3.0.4 494 10/5/2022
3.0.3 537 10/3/2022
3.0.2 498 9/30/2022
3.0.1 491 9/29/2022
2.0.17 517 9/29/2022
2.0.16 500 9/27/2022
2.0.15 564 9/27/2022
2.0.14 581 9/26/2022
2.0.13 571 9/26/2022
2.0.12 527 9/26/2022
2.0.11 524 9/25/2022
2.0.10 549 9/25/2022
2.0.9 546 9/22/2022
2.0.8 513 9/22/2022
2.0.6 532 9/20/2022
2.0.5 567 9/20/2022
2.0.4 524 9/20/2022
2.0.2 499 9/20/2022
2.0.1 556 9/13/2022
2.0.0 517 8/19/2022
1.1.24 543 7/30/2022
1.1.23 533 7/29/2022
1.1.22 539 7/29/2022
1.1.21 804 7/29/2022
1.1.20 553 7/29/2022
1.1.19 577 7/27/2022
1.1.17 544 7/27/2022
1.1.16 565 7/26/2022
1.1.15 547 7/25/2022
1.1.14 575 7/25/2022
1.1.13 551 7/22/2022
1.1.12 547 7/19/2022
1.1.11 528 7/19/2022
1.1.10 546 7/19/2022
1.1.9 573 7/19/2022
1.1.8 577 7/18/2022
1.1.7 581 7/18/2022
1.1.6 540 7/18/2022
1.1.5 523 7/17/2022
1.1.4 559 7/17/2022
1.1.3 566 7/17/2022
1.1.2 565 7/17/2022
1.1.0 550 7/17/2022
1.0.2 540 7/15/2022
1.0.1 546 7/15/2022
1.0.0 564 7/8/2022
0.10.7 544 7/7/2022
0.10.2 581 7/2/2022
0.10.1 546 7/1/2022
0.10.0 565 7/1/2022
0.9.12 584 6/29/2022
0.9.11 601 6/21/2022
0.9.10 545 6/20/2022
0.9.9 522 6/11/2022
0.9.7 535 6/9/2022
0.9.6 528 6/5/2022
0.9.5 506 6/3/2022
0.9.3 497 6/3/2022
0.9.2 537 5/31/2022
0.9.1 550 5/31/2022
0.9.0 519 5/31/2022