Alvecta.Foundation.Application.Contracts
7.0.70
dotnet add package Alvecta.Foundation.Application.Contracts --version 7.0.70
NuGet\Install-Package Alvecta.Foundation.Application.Contracts -Version 7.0.70
<PackageReference Include="Alvecta.Foundation.Application.Contracts" Version="7.0.70" />
<PackageVersion Include="Alvecta.Foundation.Application.Contracts" Version="7.0.70" />
<PackageReference Include="Alvecta.Foundation.Application.Contracts" />
paket add Alvecta.Foundation.Application.Contracts --version 7.0.70
#r "nuget: Alvecta.Foundation.Application.Contracts, 7.0.70"
#:package Alvecta.Foundation.Application.Contracts@7.0.70
#addin nuget:?package=Alvecta.Foundation.Application.Contracts&version=7.0.70
#tool nuget:?package=Alvecta.Foundation.Application.Contracts&version=7.0.70
Alvecta.Foundation.Application.Contracts
The use-case contracts of the Alvecta application layer: the interfaces a presentation adapter (an HTTP endpoint, a CLI command, a message consumer) calls, and that the application layer implements.
It belongs to the Application.Contracts layer. Contracts may speak the domain vocabulary (value objects) but never the domain model, so a presentation project can reference them without seeing entities or use-case implementations. The package has no dependencies.
What it contains
Namespace Alvecta.Foundation.Application.Contracts.Base:
| Contract | Shape |
|---|---|
IUseCase |
Task ExecuteAsync(CancellationToken) |
IUseCase<TRequest> |
Task ExecuteAsync(TRequest, CancellationToken) |
IUseCase<TRequest, TResponse> |
Task<TResponse> ExecuteAsync(TRequest, CancellationToken) |
IUseCaseWithoutRequest<TResponse> |
Task<TResponse> ExecuteAsync(CancellationToken) |
IRequestValidator<TRequest> |
void Validate(TRequest): every request-level rule of one use case, run by a validating decorator in front of it |
Namespace Alvecta.Foundation.Application.Contracts.Database:
IMigrateDatabaseUseCase— the standard "apply the database migrations" use case.
Requests and responses are classes (where TRequest : class); nesting them inside the use-case
interface keeps each use case in one file.
Usage
dotnet add package Alvecta.Foundation.Application.Contracts
Declare the use case in your *.Application.Contracts project:
using Alvecta.Foundation.Application.Contracts.Base;
public interface IGetOrderUseCase : IUseCase<IGetOrderUseCase.Request, IGetOrderUseCase.Response>
{
public sealed record Request(OrderId OrderId);
public sealed record Response(OrderId OrderId, OrderStatus Status);
}
Implement it in your *.Application project and register it with DI:
public sealed class GetOrderUseCase(IOrdersQueryService orders) : IGetOrderUseCase
{
public async Task<IGetOrderUseCase.Response> ExecuteAsync(
IGetOrderUseCase.Request request,
CancellationToken cancellationToken)
{
var status = await orders.GetStatusAsync(request.OrderId, cancellationToken);
return new(request.OrderId, status);
}
}
services.AddScoped<IGetOrderUseCase, GetOrderUseCase>();
Alvecta.Foundation.Presentation.WebApi.AspNetCore maps these interfaces to minimal-API endpoints.
| 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
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Alvecta.Foundation.Application.Contracts:
| Package | Downloads |
|---|---|
|
Alvecta.Foundation.Api.AspNetCore
Package Description |
|
|
Alvecta.Foundation.Presentation.WebApi.AspNetCore
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.0.70 | 0 | 10/22/2026 |
| 7.0.69 | 39 | 10/21/2026 |
| 7.0.68 | 41 | 10/21/2026 |
| 7.0.67 | 75 | 10/20/2026 |
| 7.0.66 | 80 | 10/19/2026 |
| 7.0.65 | 92 | 10/19/2026 |
| 6.3.64 | 92 | 10/19/2026 |
| 6.3.63 | 84 | 10/19/2026 |
| 6.2.62 | 94 | 10/14/2026 |
| 6.1.61 | 98 | 10/9/2026 |
| 6.1.60 | 101 | 10/7/2026 |
| 6.1.59 | 106 | 10/6/2026 |
| 6.1.58 | 105 | 10/5/2026 |
| 6.0.57 | 103 | 10/2/2026 |
| 6.0.56 | 104 | 10/1/2026 |
| 6.0.55 | 101 | 10/1/2026 |
| 5.0.54 | 115 | 9/30/2026 |
| 5.0.53 | 107 | 9/28/2026 |
| 5.0.52 | 110 | 9/17/2026 |
| 5.0.51 | 108 | 9/17/2026 |