When building applications, it often needs access to different configurations - be it a connection string to a database, ClientId, Secret, external API URLs, tokens, etc. By keeping these values in the application's configuration, we can use different values for different environments. ASP NET Core provides rich support for adding various configuration sources including appsettings.json, environment variables, key vault, and many more.
In this video, let's learn how to consume these configuration values from the application code you write, using the Options pattern in ASP NET Core. We will see the different interfaces supported by the pattern IOptions, IOptionsSnapshot, and see the differences between them. We can also add validations to ensure configuration values exist and enforce constraints on the values configured.
🔗Source Code - https://rahulpnath.visualstudio.com/DefaultCollection/YouTube%20Samples/_git/OptionsPattern
🔗 Options Pattern - https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-3.1&WT.mc_id=AZ-MVP-5003875
Additional Watching
📹How To Use HTTP CLIENT IN ASP NET CORE -
https://youtu.be/bAXZx0zOeCU
📹DEPENDENCY INJECTION in ASP.NET Core -
https://youtu.be/YR6HkvNBpX4
📹CONFIGURATION in ASP.NET Core -
https://youtu.be/5GlgHV_12-k
📹ASP NET Core Series - https://www.youtube.com/playlist?list=PL59L9XrzUa-nqfCHIKazYMFRKapPNI4sP
Come say hi! ✋
🌍 Blog - https://rahulpnath.com/
✉ Subscribe to my Newsletter - https://www.rahulpnath.com/subscribe
🐦Twitter - https://twitter.com/rahulpnath
📸Instagram - https://www.instagram.com/rahulpnath/
🎥 Recording Setup and Workflow - https://www.rahulpnath.com/blog/youtube_setup_and_workflow/
Video Edited by my wife, Parvathy 😍
Make sure to SUBSCRIBE to the channel. THANK YOU for helping me grow this channel !!