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
                    
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="Alvecta.Foundation.Application.Contracts" Version="7.0.70" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alvecta.Foundation.Application.Contracts" Version="7.0.70" />
                    
Directory.Packages.props
<PackageReference Include="Alvecta.Foundation.Application.Contracts" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Alvecta.Foundation.Application.Contracts --version 7.0.70
                    
#r "nuget: Alvecta.Foundation.Application.Contracts, 7.0.70"
                    
#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.
#:package Alvecta.Foundation.Application.Contracts@7.0.70
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Alvecta.Foundation.Application.Contracts&version=7.0.70
                    
Install as a Cake Addin
#tool nuget:?package=Alvecta.Foundation.Application.Contracts&version=7.0.70
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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
Loading failed