From 9791de306c22c744732219dadfd97b7dd556a5b2 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 21 Sep 2017 23:35:18 -0400 Subject: minor cleanup, formatting, documentation (#336) --- Dewdrop/Startup.cs | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'Dewdrop/Startup.cs') 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 { + /// The web app startup configuration. public class Startup { + /********* + ** Accessors + *********/ + /// The web app configuration. + public IConfigurationRoot Configuration { get; } + + + /********* + ** Public methods + *********/ + /// Construct an instance. + /// The hosting environment. 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. + /// The method called by the runtime to add services to the container. + /// The service injection container. 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. + /// The method called by the runtime to configure the HTTP request pipeline. + /// The application builder. + /// The hosting environment. + /// The logger factory. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { - loggerFactory.AddConsole(Configuration.GetSection("Logging")); + loggerFactory.AddConsole(this.Configuration.GetSection("Logging")); loggerFactory.AddDebug(); - app.UseMvc(); } } -- cgit