When to use IOptionsSnapshot or IOptionsMonitor instead of IOptions
In this video, I am reading settings from appSettings.json with IOptions pattern with DI, console application .net 8.0, and demonstrating when to use IOptionsSnapshot or IOptionsMonitor instead of IOptions.
The appsettings.json is used in .NET Core applications to read and get a value from the configuration file using the JSON format.
Creating a .NET Core console C# project using the template will not create the appsettings.json by default so to add it, we need to create an appSettings.json file for the functionality to read it in the application.
This replaces the ConfigurationManager and web.config file that was used in .NET Framework projects.
In particular, I am highlighting the benefits of using appsettings.json for settings, such as being able to group similar values into a section.
Code for this tutorial can be found on GitHub: https://github.com/musmanrafiq/techintalk_CSharp/tree/main/src/TechInTalkCSharp/FeatureFlags/Dotnet_Own/DotnetFeatureFlag_ConsoleApp
#dotnet8 #dotnetcore #appsettings #aspnetcore #configurationmanager #netcore #dotnet #Visualstudio #programming #tutorial #coding #learncsharp
Видео When to use IOptionsSnapshot or IOptionsMonitor instead of IOptions канала Usman Code
The appsettings.json is used in .NET Core applications to read and get a value from the configuration file using the JSON format.
Creating a .NET Core console C# project using the template will not create the appsettings.json by default so to add it, we need to create an appSettings.json file for the functionality to read it in the application.
This replaces the ConfigurationManager and web.config file that was used in .NET Framework projects.
In particular, I am highlighting the benefits of using appsettings.json for settings, such as being able to group similar values into a section.
Code for this tutorial can be found on GitHub: https://github.com/musmanrafiq/techintalk_CSharp/tree/main/src/TechInTalkCSharp/FeatureFlags/Dotnet_Own/DotnetFeatureFlag_ConsoleApp
#dotnet8 #dotnetcore #appsettings #aspnetcore #configurationmanager #netcore #dotnet #Visualstudio #programming #tutorial #coding #learncsharp
Видео When to use IOptionsSnapshot or IOptionsMonitor instead of IOptions канала Usman Code
.net core asp.net core tutorial asp.net core asp.net core mvc .net appsettings.json configurationmanager appsettings appsettings .net core appsettings configuration appsettings read appsettings get value from appsettings.json c# .net core C# Visual Studio programming course C# course C# training C# tutorial appsettings.json .net core appsettings.json connection string appsettings.json how to add ioptions c# ioptions asp.net core c#
Комментарии отсутствуют
Информация о видео
5 марта 2024 г. 21:09:50
00:11:00
Другие видео канала