title: Option pattern in ASP.NET
body: <p>Example I have following appsettings.json file</p>
  
  <pre><code>{
    "GrpcClient": {
      // Determine to use Insecure (true) or SSL channel (false)
      "Insecure": false,
      // SSL private key file path
      "PrivateKeyFilePath": "App_Data/Certs/client.key",
      // SSL certificate file path
      "CertificateFilePath": "App_Data/Certs/client.crt",
      // Certificate Authority certificate file paths (separate by semicolon)
      "RootCertificateFilePaths": "App_Data/Certs/messaging-ca.crt",
      // Maximum number of retry attempts for gRPC call
      "RetryCount": 5
    },
    //... there are other settings
  }
  </code></pre>
  
  <p>Here is my C# class:</p>
  
  <pre><code>public class ServiceConfig 
  {
      public GrpcClientSettings GrpcClientSettings { get; set; }
      // and few other properties, map to other settings
  }
  </code></pre>
  
  <p>Here is my startup code:</p>
  
  <pre><code>private void ConfigureSettings(IServiceCollection services)
  {
      services.Configure&lt;ServiceConfig&gt;(Configuration);
      services.AddSingleton(resolver =&gt; resolver.GetRequiredService&lt;IOptions&lt;ServiceConfig&gt;&gt;().Value);
  
      services.AddSingleton&lt;IValidatable&gt;(resolver =&gt; resolver.GetRequiredService&lt;IOptions&lt;ServiceConfig&gt;&gt;().Value);
      services.AddTransient&lt;IStartupFilter, ValidationStartupFilter&gt;();
  }
  </code></pre>
  
  <p>You see, in settings file, my json node is "GrpcClient" but the property in my c# code is "GrpcClientSettings" (at ServiceConfig class).  I still would like to keep it (there are few name conventions) but what are extra code I need to do?</p>