Exceptions & Validation¶
📕 Articles¶
- Design validations in the domain model layer
- REST API Data Validation
- Domain Model Validation
- Validation in a DDD world
- Domain Command Patterns - Validation
- Validation in Domain-Driven Design (DDD)
- Validation and DDD
- C# code contracts vs input validation
- The fallacy of the always-valid entity
- When to validate commands in CQRS?
- Exceptions for flow control in C#
- Fail Fast principle
- Functional C#: Primitive obsession ⭐
- Functional C#: Non-nullable reference types ⭐
- REST API response codes: 400 vs 500
- Functional C# Handling failures, input errors
- Prefer Custom Exceptions to Framework Exceptions
- CQRS and exception handling
- Error handling: Exception or Result?
- What is an exceptional situation in code?
- Validation and DDD
- Cool validation with FluentValidation
- Validation inside or outside entities?
- Custom Validation in ASP.NET Web API with FluentValidation
- CQRS Validation Pipeline with MediatR and FluentValidation
- Exception Handling in ASP.NET Web API - A Guided Tour
- Scaffold Your Clean DDD Web Application - Part 4: Global Exception Handling in ASP.NET Core and Angular
- Advanced error handling techniques
- Combining ASP.NET Core validation attributes with Value Objects
- Always-Valid Domain Model
- eShopOnWeb Architecture (3/16) – uses custom exceptions to more explicitly express what has gone wrong
- How to validate business logic ⭐
- Explicit validation in C# just got simpler! ⭐
- Notes about C# records and Nullable Reference Types ⭐
- Exploring Advanced Error Handling Patterns with Event Driven Architecture Part I
📦 Libraries¶
- ardalis/GuardClauses - A simple package with guard clause extensions.
- danielwertheim/Ensure.That - Guard clause project for .NET
- proudmonkey/AutoWrapper
- khellang/Middleware.ProblemDetails - Various ASP.NET Core middleware
- ardalis/GuardClauses - A simple package with guard clause extensions.
- JosephWoodward/GlobalExceptionHandlerDotNet - Exception handling as a convention in the ASP.NET Core request pipeline.
- safakgur/guard - A high-performance, extensible argument validation library.
- FluentValidation/FluentValidation - A popular .NET validation library for building strongly-typed validation rules.
- mcintyre321/OneOf - Easy to use F#-like discriminated unions for C# with exhaustive compile time matching
- ardalis/Result - A result abstraction that can be mapped to HTTP response codes if needed.
- altmann/FluentResults - A generalised Result object implementation for .NET/C#