Get Rid of Exceptions in Your Code With the Result Pattern
Get the source code for this video for FREE → https://the-dotnet-weekly.ck.page/res... ☄️ Master the Modular Monolith Architecture: https://bit.ly/3SXlzSt 📌 Accelerate your Clean Architecture skills: https://bit.ly/3PupkOJ 🚀 Support me on Patreon to access the source code: / milanjovanovic I will show you two approaches for Domain validation with .NET. The first approach will be based on throwing exceptions. The second approach will be based on returning a result object. I'll show you how to extend the Result pattern with errors and clean up your design. It's more performant and expressive than throwing exceptions. Which validation approach would you choose? I prefer expressing errors using the Result pattern. Join my weekly .NET newsletter: https://www.milanjovanovic.tech Read my Blog here: https://www.milanjovanovic.tech/blog Chapters 0:00 Why I don't prefer throwing exceptions 2:36 Returning error messages instead of throwing exceptions 3:31 Adding an Error type express errors in the domain 5:44 Documenting domain errors for a better design 7:48 Using a Result object to represent success or failure

The New Global Error Handling in ASP.NET Core 8

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

Replace Switch Statements with the Strategy Pattern in C#

Don't throw exceptions in C#. Do this instead

Create Login Page Using Identity Authentication in ASP.NET Core MVC

Why Shopify Rejected Microservices (And What They Did Instead)

Top 10 C# Mistakes that will get you in trouble

C# is cool again and you can't avoid it anymore...

The Logging Everyone Should Be Using in .NET

Exceptions Are Extremely Expensive… Do This Instead

Exposing The Solid State Donut Battery. It's Over.

See How a 453kg Giant Bluefin Tuna Is Flawlessly Carved in Seconds

Why Senior Devs Build Their Own Monads

Discriminated Unions Are Finally in .NET But

When to Use Classes and Structs in .NET

Design a File Upload Service Like a Senior Engineer

How Rockstar fit an entire city into PlayStation 2 memory

Async Await Just Got A Massive Improvement in .NET

Andrej Karpathy: From Vibe Coding to Agentic Engineering w/ Stephanie Zhan

