Beispiel #1
0
 /// <summary>
 /// Initialize the configuration manager
 /// </summary>
 public static IApplicationBuilder UseConfigurationFile(
     this IApplicationBuilder builder,
     string fileLocation)
 {
     builder.BuildActionsCoordinator.AddAction(DefaultBuildActions.ConfigFileBuildAction((container) =>
     {
         var config = container.Resolve <IConfigurationManager>();
         config.Initialize(fileLocation, new ConfigurationFile("config", Path.Combine(fileLocation, "config.cfg")));
     }));
     return(builder);
 }
Beispiel #2
0
 /// <summary>
 /// Initialize the configuration manager
 /// </summary>
 /// <param name="builder">the application builder.</param>
 /// <param name="fileLocation"></param>
 /// <param name="defaultFile">The default configurations file.</param>
 public static IApplicationBuilder UseConfigurationFile(
     this IApplicationBuilder builder,
     string fileLocation,
     IConfigurationFile defaultFile = null)
 {
     builder.BuildActionsCoordinator.AddAction(DefaultBuildActions.ConfigFileBuildAction((container) =>
     {
         var config = container.Resolve <IConfigurationManager>();
         config.Initialize(fileLocation, defaultFile);
     }));
     return(builder);
 }