Options pattern https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetcore-7.0 OptionMonitor OptionSnapshot IConfiguration Option -> once application is loaded the value will not change. The application has to be restarted. Aws Systems Manager - create parameter store https://www.youtube.com/watch?v=J0EVd5HbtUY
Delegate: pointer to a function Eg. Photo class -> Load and Save methods Photofilters -> Contains different types of filters. Eg., BWFilter, Contrast, Brightness, Resize etc PhotoProcessor -> Takes the path, loads a photo, applies some filters and saves the Photo. If a developer wants to develop a new filter, he has to download the code, create the filter and then make changes to PhotoProcessor. Instead of PhotoProcessor taking the actual filters class, will take a PhotoFilterHandler delegate and will take as parameter. public delegate PhotoFilterHandler(Photo photo); public Photo process(string path, PhotoFilterHandler filter){ photo.Load(path); filter(photo); photo.Save(); } while implementing it create an instance photoprocessor class. Create an instance of PhotoFilterHandler var filterHandler = photoFilter.ApplyBWFilter; filterHandler += photoFilter.ApplyBrightnessFilter; filterHandler += Resize; photoProcessor.process("c:\\photos\\photo1.png", filterHandler); ...
How to pass command line arguments in Visual Studio 2022? Right-click Projects -> Properties In the window select Debug -> General -> Open debug launch profiles UI How to access the command line variables when top-level statements is used? Console.WriteLine("Hello, World!"); foreach(var s in args) { Console.Write($"{s}, "); } For more information about top-level statements follow this url: https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/top-level-statements
Comments
Post a Comment