Purview.EventSourcing.Admin.Client
2.0.0-prerelease.34
dotnet add package Purview.EventSourcing.Admin.Client --version 2.0.0-prerelease.34
NuGet\Install-Package Purview.EventSourcing.Admin.Client -Version 2.0.0-prerelease.34
<PackageReference Include="Purview.EventSourcing.Admin.Client" Version="2.0.0-prerelease.34" />
<PackageVersion Include="Purview.EventSourcing.Admin.Client" Version="2.0.0-prerelease.34" />
<PackageReference Include="Purview.EventSourcing.Admin.Client" />
paket add Purview.EventSourcing.Admin.Client --version 2.0.0-prerelease.34
#r "nuget: Purview.EventSourcing.Admin.Client, 2.0.0-prerelease.34"
#:package Purview.EventSourcing.Admin.Client@2.0.0-prerelease.34
#addin nuget:?package=Purview.EventSourcing.Admin.Client&version=2.0.0-prerelease.34&prerelease
#tool nuget:?package=Purview.EventSourcing.Admin.Client&version=2.0.0-prerelease.34&prerelease
Purview.EventSourcing.Admin.Client
Purview.EventSourcing.Admin.Client is a typed C# client for the Purview Event Sourcing Admin API, generated by NSwag from the committed OpenAPI document (OpenApi/admin.openapi.json). It exposes strongly-typed methods for every Admin API endpoint and is used by the Admin portal Razor UI (Purview.EventSourcing.Admin.Site) and samples.
Install
dotnet add package Purview.EventSourcing.Admin.Client
Register the client
builder.Services.AddAdminApiClient();
When AdminClientOptions.BaseUrl is not configured, the client sends relative request URIs so it can be pointed at the Admin API's origin by the hosting application:
builder.Services.AddAdminApiClient(options =>
{
options.BaseUrl = new Uri("https://admin.example.com");
options.AccessToken = "optional-bearer-token";
});
AddAdminApiClient registers AdminApiClient as a typed HttpClient through IHttpClientFactory. The optional configureClient hook lets callers add delegating handlers (for example to resolve a same-origin base URL from the current HTTP request).
The generated client targets the Admin API route prefix from the OpenAPI document (by default /admin/api).
Usage
var client = serviceProvider.GetRequiredService<AdminApiClient>();
var aggregates = await client.SearchAggregatesAsync(
new AggregateSearchRequest { AggregateType = "OrderAggregate", PageSize = 25 },
cancellationToken
);
var events = await client.GetAggregateEventRangeAsync(
"OrderAggregate",
aggregateId,
pageSize: 25,
cancellationToken: cancellationToken
);
var export = await client.ExportAggregateEventsAsync("OrderAggregate", aggregateId);
Methods:
SearchAggregatesAsync(AggregateSearchRequest body)GetAggregateAsync(string aggregateType, string aggregateId)GetAggregateEventRangeAsync(string aggregateType, string aggregateId, ...)GetAggregateProjectionAtVersionAsync(string aggregateType, string aggregateId, long? version)GetAggregateProjectionAtTimeAsync(string aggregateType, string aggregateId, DateTimeOffset? asOfUtc)ExportAggregateEventsAsync(string aggregateType, string aggregateId, ...)returning aFileResponseover the JSON Lines stream
Non-success responses throw AdminApiException.
Regenerating the client
The client is generated from the Admin API OpenAPI document. After changing the Admin API contracts or endpoints:
just admin-openapi-export # regenerate OpenApi/admin.openapi.json
just admin-client-generate # regenerate Generated/AdminApiClient.g.cs via NSwag
Both the OpenAPI document and the generated client are committed, so consumers get a deterministic, reviewable client.
Notes
- Uses
System.Text.Json(no Newtonsoft dependency). - The
JsonElementDTO carries raw event/projection JSON in itsAdditionalPropertiesdictionary. - When
BaseUrlis left unset, the hosting application must resolve the origin (for examplePurview.EventSourcing.Admin.Sitedoes this via a delegating handler that reads the current HTTP request).
Documentation
Related packages
- Admin API:
Purview.EventSourcing.Admin.Api - Admin site:
Purview.EventSourcing.Admin.Site
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Logging (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Telemetry.Abstractions (>= 10.10.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Purview.EventSourcing.Admin.Client:
| Package | Downloads |
|---|---|
|
Purview.EventSourcing.Admin.Site
Ready-to-use Razor Pages admin dashboard for Purview EventSourcing Admin Portal. Provides web UI for aggregate search, event inspection, and point-in-time projection queries. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-prerelease.34 | 0 | 9/18/2026 |
| 2.0.0-prerelease.33 | 31 | 9/17/2026 |
| 2.0.0-prerelease.32 | 50 | 9/15/2026 |
| 2.0.0-prerelease.31 | 57 | 9/12/2026 |
| 2.0.0-prerelease.30 | 72 | 9/8/2026 |
| 2.0.0-prerelease.29 | 59 | 9/4/2026 |