Skip to content

Instantly share code, notes, and snippets.

@goldytech
Created March 6, 2016 06:27
Show Gist options
  • Save goldytech/bf619f9eb592584b6ac5 to your computer and use it in GitHub Desktop.
Save goldytech/bf619f9eb592584b6ac5 to your computer and use it in GitHub Desktop.
ConfigureServices and Configure methods in Startup.cs of Asp.net core
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddSingleton<IDataService, DataService>();
services.AddSingleton<IViewModelService, ViewModelService>();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app)
{
app.UseIISPlatformHandler();
app.UseMvcWithDefaultRoute();
app.UseStaticFiles();
app.UseStatusCodePages();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment