Skip to content
0:00 / 0:00

#dotnet#csharp#fluentvalidation

The Best Way to Validate Your Settings in .NET

Nick Chapsas

429K subscribers • 62 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Nick Chapsas

Intermediate. Assumes working knowledge.

67K views3 years ago2 recommendations

Software designTools and practiceC# and .NETSoftware architectureDesign patterns

Nick Chapsas demonstrates how to validate configuration settings and options in .NET applications, including using FluentValidation.

Check out my courses: dometrain.com Become a Patreon and get source code access: patreon.com/nickchapsas Hello everybody I'm Nick and in this video I will show you how you can validate your settings or options for your .NET and ASP.NET Core applications. I'm also going to show you how you can extend that to use FluentValidations too. Workshops: bit.ly/nickworkshops Don't forget to comment, like and subscribe :) Social Media: Follow me on GitHub: bit.ly/ChapsasGitHub Follow me on Twitter: bit.ly/ChapsasTwitter Connect on LinkedIn: bit.ly/ChapsasLinkedIn Keep coding merch: keepcoding.shop #csharp #dotnet

Why it's here

2 people recommend this

What people say. Recommended for its clear explanation of the .NET options pattern and how to force validation on startup.

u/DagNabbin r/dotnet • Recommends

On “Best practices for Configuration”

Nick Chapsas just did nice a video highlighting benefits and features of options: [video

u/The_MAZZTerin r/dotnet • Recommends

On “Validate that the configuration class loaded has values on Startup”

I watched this video recently it covers this exact topic. link to this video He covers how to force options to validate on startup (as opposed to when you access them), as well as writing custom validators if you need them. One thing he mentions is you should use GetRequiredSeciton (not GetSection) to ensure a section exists in one of your appsettings JSON files. But the whole video is worth a watch imo.