Model Validation | Validation Attributes vs. FluentValidation | .NET 6
Become a Patreon & get the source code: / amantinband In this video, we'll learn how to use the built-in validation attributes for model validation and also how we can create custom validation attributes to match our needs. We'll then cover some of the reasons why we might prefer using the FluentValidation library instead. In the FluentValidation library, we'll cover the following: 0. FluentValidation vs FluentValidation.AspNetCore 1. FluentValidation built-in validators 2. FluentValidation custom validators 3. FluentValidation and Dependency Injection 4. FluentValidation & nested objects 5. FluentValidation & including rules from other validators 6. FluentValidation's built-in Message Placeholders 7. FluentValidation & Custom Placeholders Give FluentValidation a ⭐: https://github.com/FluentValidation/F... #dotnet 00:00. The project we'll be using as an example 02:15. Built-in Validation Attributes 03:05. Returning a ValidationProblem when the ModelState isn't valid 04:00. ApiController Attribute - Automatic 400 responses & Automatic binding 05:00. Custom Validation Attributes 06:14. Custom Validation Attributes: Custom Error Message 07:12. Validation Attributes vs. FluentValidation 08:31. Adding the FluentValidation Nuget package 08:41. Implementing our first Validator 09:38. Registering the Validator using the IValidator interface 10:06. FluentValidation Manual Validation 11:52. Adding the FluentValidation.AspNetCore Nuget package 12:06. Registering the Validator using the AddValidatorsFromAssemblyContaining extension method 12:56. FluentValidation Automatic Validation (AddFluentValidation extension method) 13:32. FluentValidation Automatic Validation disclaimer 14:20. FluentValidation Built-in validators (RuleFor, Must, NotNull, NotEmpty, CreditCard, Match) 15:05. Validators & Dependency Injection 16:05. FluentValidation RuleForEach & WithMessage 17:11. FluentValidation Custom Validator (IRuleBuilderOptions, IRuleBuilder) 19:55. Custom Validator & Custom error message 20:20. Built-in Placeholders (PropertyName, PropertyValue) 21:06. Custom Placeholders (ValidationContext, MessageFormatter) 22:33. Updating the CreateBreakfastRequest to have a nested object 23:50. Implementing the BreakfastDetailsValidator 23:50. Implementing the BreakfastDetailsValidator 24:40. Setting an external validator on nested objects (SetValidator) 25:20. Splitting rules across multiple files (Include) 26:51. Next video sneak peek

Validation Behavior | MediatR + FluentValidation | CLEAN ARCHITECTURE & DDD Tutorial | Part 8

How to create powerful validation with FluentValidation in .NET apps

Object Mapping - Mapster | ASP.NET 6 REST API Following CLEAN ARCHITECTURE & DDD Tutorial | Part 7

Welcome to .NET 9 - .NET Conf 2024 Keynote

Generating JWT Tokens | ASP.NET 6 REST API Following CLEAN ARCHITECTURE & DDD Tutorial | Part 2

Dependency Injection Deep Dive | .NET & C# Essentials

ASP.NET Core Tutorial for Beginners | .NET 7

Intro to MediatR - Implementing CQRS and Mediator Patterns

FluentValidation for Powerful ASP.Net Core Model Validation | Tutorial

ASP.NET Core Full Course For Beginners (.NET 10)

Google & AWS Veteran: What Top Tier Software Architects Do Differently

What’s the Result Type Everyone Is Using in .NET?

The AI Take Over Has Completely Backfired and I Can't Be Happier

🚗 BYD : The biggest SCAM of the car industry ?

Zig 2026: No-AI Policy, $670K Foundation, Left GitHub & Why Zig Isn’t 1.0 - Andrew Kelley Explains

Co-Creator of Haskell: Why Learn Functional Programming, Useless vs Useful Languages | Simon Jones

Claude Fable 5 vs GPT 5.5 | Head to Head Coding Battle

Model Validation: Detailed Process

Clean Architecture with ASP.NET Core 8 | .NET Conf 2023

