File tree Expand file tree Collapse file tree
ProjectTemplates/ReferenceProject Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ namespace ReferenceProject.Configuration
66{
77 public static class ApplicationSettings
88 {
9- public static void AddSettings ( this IServiceCollection services , IConfiguration configuration )
9+ public static void AddSettings ( this IServiceCollection services )
1010 {
1111 services . AddOptions < Settings . Products > ( )
12- . Bind ( configuration . GetSection ( Settings . Products . SectionName ) )
12+ . AutoBind ( )
1313 . SubstituteVariables ( ) ;
1414 }
1515 }
Original file line number Diff line number Diff line change 3333 <PackageReference Include =" Autofac.Configuration" Version =" 5.1.0" />
3434 <PackageReference Include =" Autofac.Extensions.DependencyInjection" Version =" 6.0.0" />
3535 <PackageReference Include =" AutoMapper.Extensions.Microsoft.DependencyInjection" Version =" 7.0.0" />
36+ <PackageReference Include =" Contrib.Extensions.Configuration.AutoBind" Version =" 1.0.0" />
3637 <PackageReference Include =" Contrib.Extensions.Configuration.VariablesSubstitution" Version =" 0.1.0-beta1" />
3738 <PackageReference Include =" DotNetEnv" Version =" 1.4.0" />
3839 <PackageReference Include =" Microsoft.AspNet.WebApi.Client" Version =" 5.2.7" />
Original file line number Diff line number Diff line change 33 // TODO: Describe Option Pattern
44 public class Products
55 {
6- public const string SectionName = "Products" ;
7-
86 public string TempFolder { get ; set ; }
97 public string BackendServiceUrl { get ; set ; }
108 }
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ public void ConfigureServices(IServiceCollection services)
9797 services . AddControllers ( ) ;
9898 services . AddHealthChecks ( ) ;
9999
100- services . AddSettings ( Configuration ) ;
100+ services . AddSettings ( ) ;
101101 }
102102
103103 /// <summary>
You can’t perform that action at this time.
0 commit comments