Rystem.RepositoryFramework.Api.Client 2.0.2

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

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

What is Rystem?

Services extensions

You may add a repository client for your model. You may choose the domain (domain where the api is), and the custom path by default is "api", you may add custom configuration to the HttpClient and the service lifetime with singleton as default. The api url will be https://{domain}/{startingPath}/{ModelName}/{Type of Api (from Insert, Update, Delete, Batch, Get, Query, Exist, Operation)}

public static IRepositoryBuilder<T, TKey> AddRepositoryApiClient<T, TKey>(this IServiceCollection services,
    string domain,
    string startingPath = "api",
    Action<HttpClient>? configureClient = null,
    ServiceLifetime serviceLifetime = ServiceLifetime.Singleton)
    where TKey : notnull

You have the same client for CQRS, with command

 public static IRepositoryBuilder<T, TKey> AddCommandApiClient<T, TKey>(this IServiceCollection services,
    string domain,
    string startingPath = "api",
    Action<HttpClient>? configureClient = null,
    ServiceLifetime serviceLifetime = ServiceLifetime.Singleton)
    where TKey : notnull

and query

  public static IRepositoryBuilder<T, TKey> AddQueryApiClient<T, TKey>(this IServiceCollection services,
    string domain,
    string startingPath = "api",
    Action<HttpClient>? configureClient = null,
    ServiceLifetime serviceLifetime = ServiceLifetime.Singleton)
    where TKey : notnull

HttpClient to use your API (example)

You can add a client for a specific url

services.AddRepositoryApiClient<User, string>("localhost:7058");

and use it in DI with

IRepository<User, string> repository

Query and Command

In DI you install the services

services.AddCommandApiClient<User, string>("localhost:7058");
services.AddQueryApiClient<User, string>("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.AddRepositoryApiClient<User, bool>("localhost:7058");
services.AddCommandApiClient<User, bool>("localhost:7058");
services.AddQueryApiClient<User, bool>("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

With string as default TKey

In DI you install the services

services.AddRepositoryApiClient<User>("localhost:7058");
services.AddCommandApiClient<User>("localhost:7058");
services.AddQueryApiClient<User>("localhost:7058");

And you may inject the objects

IRepository<User> repository
ICommand<User> command
IQuery<User> command

Interceptors

You may add a custom interceptor for every request for every model

public static IServiceCollection AddRepositoryApiClientInterceptor<TInterceptor>(this IServiceCollection services,
    ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
    where TInterceptor : class, IRepositoryClientInterceptor

or a specific interceptor for each model

public static RepositoryBuilder<T, TKey> AddApiClientSpecificInterceptor<T, TKey, TInterceptor>(this RepositoryBuilder<T, TKey> builder,
    ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
    where TInterceptor : class, IRepositoryClientInterceptor<T>
    where TKey : notnull

or for a string as default TKey

public static RepositoryBuilder<T> AddApiClientSpecificInterceptor<T, TInterceptor>(this RepositoryBuilder<T> builder,
    ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
    where TInterceptor : class, IRepositoryClientInterceptor<T>   

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.AddApiClientAuthorizationInterceptor();

This line of code inject an interceptor that works with ITokenAcquisition, injected by the framework during OpenId integration (for example AAD integration). Automatically it adds the token to each request.

You may use the default identity interceptor not on all repositories, you can specificy them with

builder.Services.AddApiClientSpecificAuthorizationInterceptor<YourModel>();
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 212,880 4/3/2024
6.0.3 112 3/25/2024
6.0.2 393,397 3/11/2024
6.0.0 1,170,017 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,463 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 341 1/4/2023
4.1.0 327 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 522 7/17/2022
1.1.0 510 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