The Options Pattern in a .NET 8 Web API 🚀 Better than using IConfiguration?

preview_player
Показать описание
💻 Use Code LONGERNIGHTS to get 20% off on any course or plan!

In this video, we explore the power of the Options Pattern in a .NET 8 Web API! We'll compare it with the traditional IConfiguration approach and see which offers more advantages for your projects.

📚 My .NET & Blazor Udemy Courses:
💻 Use Code LONGERNIGHTS to get 20% off on any course or plan!

📑 Table of Contents:
00:00 The Options Pattern in a .NET 8 Web API 🚀
01:02 Web API Project Overview
01:49 Implement the IConfiguration approach
03:18 Implement the Options Pattern
06:00 Test the Implementations
06:10 Retrieve a single value from the settings

🏷️ #DotNet #DotNet8 #WebAPI
Рекомендации по теме
Комментарии
Автор

If you had multiple sections in the appsettings.json for example PlayerSettings, GameSettings, and CheatSettings. Would you configure 3 separate services in the program.cs? Or would you create an outer section in the appsettings, json and then configure only 1 in the program.cs ie. AllSettings. To me, it makes sense to do 1?

daraghodonoghue_
Автор

Can you also make a video about Docker and .NET in the future? It would help me 😅🙂

zhelwar
Автор

In my experience. I just use it to write a library.

PhuocTran-li
Автор

But it has nothing to do with Net8. It's part of the Microsoft.Extensions libraries which were implemented like 10 years ago.

Chris-zbnm
Автор

Concise. Easy to follow. Brilliant. Thanks Patrick!

ebarednaxela
Автор

Clear and informative. I like this length for videos!

JohanNordberg
Автор

Nice, I was missing the IOptions<> wrapper that's why its not working

mumk
Автор

Thanks for the video, Patrick.

Could you make a video on Blazor SSR Authentication with OIDC (Identity Server or KeyCloak)? because this is a real pain when migrating.

youssefwael
Автор

i need example for blazor hybrid with mobile devices

shabanelmogy
Автор

Really nice feature, saves us some boilerplate code to get the type safety

nikolayrogchev
Автор

Thanks for making it simple to understand

mahaalghamdi
Автор

thanks so much, options pattern has more like snapshot etc.

Omar.bin.khattab