Answers for "Options Pattern startup.cs configuration"

C#
0

Options Pattern startup.cs configuration

// Startup.cs
public class Startup
{
    ...
 
    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {
        ...
 
        services.AddOptions<RoundTheCodeSync>().Bind(Configuration.GetSection("RoundTheCodeSync"));        
    }
}
Posted by: Guest on September-30-2021

C# Answers by Framework

Browse Popular Code Answers by Language