ASP.NET
Arch is built on the ASP.NET platform.
To get started with the Comments Api, add its NuGet package to your program, register it with the service collection, and work with its client.
NuGet Setup
Add NuGet package
TriunniaLabs.Arch.Api.Comments.Client to your project.
Note that we use our own
NuGet package feed, which you must add as a package source in your environment.
Service Setup
In the main
Service Composition section of your program startup, make the call to
AddTriunniaLabsCommentsApi() to add the Comments Api.
This reads the CommentsApi configuration section, registers the Comments Api client with its resilience policies, and provides a callback for its types to be registered with the message formatter.
builder.Services.AddTriunniaLabsCommentsApi(builder.Configuration,
builder.Services.AddStandardMessagePackFormatters);
See:
Program.cs
Accessing the Comments Api
Access the Comments Api by injecting the
ICommentsApiClient.
See
CommentsApiSampleController.cs
for examples of how to use its functions. Note that all parameters passed to these functions must be
Protected Types (Protected<T>).
The encryption key must be supplied on every create, update, and read call — the server applies it per operation and does not retain it between calls.