Soenneker.Exceptions.Suite 11.0.707

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

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Exceptions.Suite

A small set of application-layer exception types for entity conflicts, missing entities, authentication, authorization, and validation failures.

Install

dotnet add package Soenneker.Exceptions.Suite

Exception types

Exception Intended condition Common HTTP mapping
EntityAlreadyExistsException Creation conflicts with an existing entity 409 Conflict
EntityNotFoundException A requested entity does not exist 404 Not Found
UnauthorizedException Authentication is missing or failed 401 Unauthorized
ForbiddenException An authenticated caller lacks permission 403 Forbidden
ValidationException Supplied data fails application validation 400 Bad Request

The HTTP statuses are suggested application mappings. Throwing one of these exceptions does not create an HTTP response, log the error, roll back work, or register middleware.

Usage

using Soenneker.Exceptions.Suite;

if (await repository.Exists(id))
    throw new EntityAlreadyExistsException($"Widget '{id}' already exists.");

Widget? widget = await repository.Find(id);

if (widget is null)
    throw new EntityNotFoundException(typeof(Widget), id);

Map exceptions at the application boundary rather than catching and translating them throughout domain code. For example, ASP.NET Core middleware or an exception handler can translate known types to ProblemDetails, while unexpected exceptions remain server errors.

EntityNotFoundException has constructors that build a message from an entity name/type and optional key:

throw new EntityNotFoundException("Widget", "widget-123");
// Entity "Widget" (widget-123) was not found.

The key is included in Message through ToString(). Do not pass secrets or sensitive identifiers if exception messages may be logged or returned to clients. In general, expose stable client-safe problem details and keep internal exception messages out of production responses.

ValidationException carries only the standard exception message and inner exception; it does not provide a structured field-error collection. Its name can conflict with validation exceptions from other namespaces, so use a namespace alias or the fully qualified name when both are referenced.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net11.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Soenneker.Exceptions.Suite:

Package Downloads
Soenneker.Utils.UserContext

A utility library for retrieving various user information from the request context

Soenneker.Graph.Users

Microsoft Graph user creation, update, lookup, paging, and queued deletion operations.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.707 834 11/11/2026
11.0.706 3,238 10/27/2026
11.0.705 500 10/26/2026
11.0.704 541 10/26/2026
4.0.703 1,512 10/14/2026
4.0.702 291 10/14/2026
4.0.697 315 10/12/2026
4.0.696 159 10/12/2026
4.0.695 804 10/11/2026
4.0.694 3,418 9/24/2026
4.0.693 1,707 9/15/2026
4.0.692 1,078 9/12/2026
4.0.691 5,251 8/30/2026
4.0.689 6,194 7/28/2026
4.0.688 2,145 7/16/2026
4.0.687 5,285 6/18/2026
4.0.686 3,870 6/5/2026
4.0.685 159 6/5/2026
4.0.684 4,351 4/22/2026
4.0.683 3,886 3/12/2026
Loading failed

Upgrade .NET 11 release candidates to stable