Created
March 6, 2016 06:27
-
-
Save goldytech/bf619f9eb592584b6ac5 to your computer and use it in GitHub Desktop.
ConfigureServices and Configure methods in Startup.cs of Asp.net core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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