diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-09-21 23:35:18 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-09-21 23:35:18 -0400 |
commit | 9791de306c22c744732219dadfd97b7dd556a5b2 (patch) | |
tree | f320674827f3535cf238106070fefd5a762a2a0f /Dewdrop/Startup.cs | |
parent | 57d9d28554de79734401a68ee1151fc4e9e0ca83 (diff) | |
download | SMAPI-9791de306c22c744732219dadfd97b7dd556a5b2.tar.gz SMAPI-9791de306c22c744732219dadfd97b7dd556a5b2.tar.bz2 SMAPI-9791de306c22c744732219dadfd97b7dd556a5b2.zip |
minor cleanup, formatting, documentation (#336)
Diffstat (limited to 'Dewdrop/Startup.cs')
-rw-r--r-- | Dewdrop/Startup.cs | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/Dewdrop/Startup.cs b/Dewdrop/Startup.cs index 00c18bab..d1618037 100644 --- a/Dewdrop/Startup.cs +++ b/Dewdrop/Startup.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -10,33 +6,46 @@ using Microsoft.Extensions.Logging; namespace Dewdrop { + /// <summary>The web app startup configuration.</summary> public class Startup { + /********* + ** Accessors + *********/ + /// <summary>The web app configuration.</summary> + public IConfigurationRoot Configuration { get; } + + + /********* + ** Public methods + *********/ + /// <summary>Construct an instance.</summary> + /// <param name="env">The hosting environment.</param> public Startup(IHostingEnvironment env) { - var builder = new ConfigurationBuilder() + this.Configuration = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) - .AddEnvironmentVariables(); - Configuration = builder.Build(); + .AddEnvironmentVariables() + .Build(); } - public IConfigurationRoot Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. + /// <summary>The method called by the runtime to add services to the container.</summary> + /// <param name="services">The service injection container.</param> public void ConfigureServices(IServiceCollection services) { - // Add framework services. services.AddMvc(); } - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + /// <summary>The method called by the runtime to configure the HTTP request pipeline.</summary> + /// <param name="app">The application builder.</param> + /// <param name="env">The hosting environment.</param> + /// <param name="loggerFactory">The logger factory.</param> public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { - loggerFactory.AddConsole(Configuration.GetSection("Logging")); + loggerFactory.AddConsole(this.Configuration.GetSection("Logging")); loggerFactory.AddDebug(); - app.UseMvc(); } } |