codewithmukesh

Share this post

Options Pattern in ASP.NET Core

codewithmukesh.substack.com

Options Pattern in ASP.NET Core

Are you loading your configuration from appsettings.json the correct way?

Mukesh Murugan
Apr 23, 2023
1
Share
Share this post

Options Pattern in ASP.NET Core

codewithmukesh.substack.com

How do you load & validate your Configurations in ASP.NET Core applications from appsettings.json? 🤔

I wrote about the Options Pattern in ASP.NET Core, which provides strongly-typed classes to access your settings from the appsettings file. In addition to this, the Options pattern also includes features like data annotations validation, startup validations, custom validations, and reloading the latest configurations at runtime using the IOptionsSnapshot & IOptionsMonitor interfaces.

Are you using this pattern in your application? If not, it's definitely a neat feature to have.🔥

Here are the covered topics.

➡️IConfiguration

➡️Getting Started with Options Pattern in ASP.NET Core

➡️Data Annotations & Validations

➡️Startup Validation

➡️Custom Validation

➡️Reloading Configurations – Options Interfaces

➡️Difference between IOptionsMonitor vs. IOptionsSnapshot?

➡️When to use IOptions, IOptionsMonitor, and IOptionsSnapshot?

➡️How to Load Configurations in Program.cs?

Read: https://codewithmukesh.com/blog/options-pattern-in-aspnet-core/

1
Share
Share this post

Options Pattern in ASP.NET Core

codewithmukesh.substack.com
Previous
Next
Comments
Top
New
Community

No posts

Ready for more?

© 2023 Mukesh Murugan
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing