NOF.Contract 9.0.0

dotnet add package NOF.Contract --version 9.0.0
                    
NuGet\Install-Package NOF.Contract -Version 9.0.0
                    
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="NOF.Contract" Version="9.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NOF.Contract" Version="9.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NOF.Contract" />
                    
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 NOF.Contract --version 9.0.0
                    
#r "nuget: NOF.Contract, 9.0.0"
                    
#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 NOF.Contract@9.0.0
                    
#: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=NOF.Contract&version=9.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NOF.Contract&version=9.0.0
                    
Install as a Cake Tool

NOF.Contract

Contract layer package for the NOF Framework.

Overview

Defines the messaging contracts and shared models that form the public API surface of your application. This package contains request/command/notification interfaces, the Result<T> type, and HTTP endpoint attributes with source generation support.

Key Abstractions

Messages

// Request with response
public record GetOrderRequest(Guid Id);

// Request without response
public record ArchiveOrderRequest(Guid Id);

// Fire-and-forget command
public record SendEmailCommand(string To, string Subject, string Body) : ICommand;

// Publish/subscribe notification
public record OrderCreatedNotification(Guid OrderId) : INotification;

Result Type

// Success
return Result.Success(orderDto);

// Failure
return Result.Fail("404", "Order not found");

[HttpEndpoint]

Marks a request type for automatic HTTP endpoint generation via source generator.

[HttpEndpoint(HttpVerb.Get, "/api/orders/{id}")]
public record GetOrderRequest(Guid Id);

[HttpEndpoint(HttpVerb.Post, "/api/orders")]
public record CreateOrderRequest(string ProductName, int Quantity);

Other Annotations

  • [RequirePermission] - declares required permissions for an endpoint
  • [EndpointName] / [Description] - OpenAPI metadata
  • [Summary] - adds summary documentation to generated endpoints

Installation

dotnet add package NOF.Contract

License

Apache-2.0

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 (7)

Showing the top 5 NuGet packages that depend on NOF.Contract:

Package Downloads
NOF.Application

Application layer for the NOF Framework — request/command/notification handlers, state machines, caching, and unit of work.

NOF.Test

Testing support for applications built with NOF, including lightweight test hosts, scoped execution helpers, and application-oriented integration testing utilities.

NOF.Hosting.Abstraction

Hosting abstractions for the NOF Framework — host builder interfaces and step contracts shared by different hosting environments.

NOF.Application.Extension.Redis

Redis application extension for the NOF Framework — advanced Redis cache abstractions built on top of NOF caching.

NOF.UI

Reusable UI primitives for the NOF Framework - authorization components, browser storage abstractions, and client-side cache services.

GitHub repositories

This package is not used by any popular GitHub repositories.