Skip to content

Instantly share code, notes, and snippets.

@AbhinavPradeep
Created February 10, 2020 11:28
Show Gist options
  • Save AbhinavPradeep/5e2b1faf2a2ad37fa5a04f405a606770 to your computer and use it in GitHub Desktop.
Save AbhinavPradeep/5e2b1faf2a2ad37fa5a04f405a606770 to your computer and use it in GitHub Desktop.
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Theta.Customers.API.Configuration;
namespace Theta.Customers.API
{
public class Startup
{
public IConfiguration Config { get; }
public Startup(IConfiguration config)
{
this.Config = config;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddOptions();
services.AddMvc();
services.Configure<CustomerSettings>(Config.GetSection("CustomerSettings"));
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseMvc();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment