Here are the steps to add MVC to your application:
1. Open the Startup.cs file, then in "ConfigureServices" method type in the following to enable MVC
public void ConfigureServices(IServiceCollection services) { services.AddMvc(); }
2. As with the static files, there will be a red underline on the .AddMvc() method that's because we haven't added the package to your project yet. So click on the yellow light and select the first option to add Microsoft.AspNET.Mvc package to our project.
3. Now go into the Configure method and type app.UseMvc() into the method, the final markup should look like the following
public void Configure(IApplicationBuilder app) { app.UseStaticFiles(); app.UseMvc(); }
Even though we have enabled MVC in our application we haven't configure any routes for it. We will do that in the next post. Stay tuned!
ASP.NET Core Posts:
- How To Create An ASP.NET Core Application From Scratch
- ASP.NET Core : Add jQuery, Bootstrap, AngularJS Using bower.json
- Enable MVC On ASP.NET Core Application
- ASP.NET Core : Create Our First Controller and View
- ASP.NET Core : Adding The Default View With _ViewStart.cshtml
- ASP.NET Core : Create A Responsive Layout With Bootstrap
- ASP.NET Core : Adding Font-Awesome For Northwind Cafe Navigation Icons
- ASP.NET Core : Add .json Configuration Files With Microsoft.Extensions.Configuration Library
- ASP.NET Core : Entity Framework Core Models For Northwind Cafe
- ASP.NET Core : Create The NothwindContext ( EntityFrameworkCore )
- ASP.NET Core : Configure project.json File To Support Entity Framework Core
- ASP.NET Core : Add NorthwindContext To Startup Class And Create Database
- ASP.NET Core: Seeding The NorwindCafe Database
- ASP.NET Core: Add Logging To The NorthwindCafe Application
Mua vé tại đại lý vé máy bay Aivivu, tham khảo
ReplyDeletevé máy bay đi Mỹ bao nhiêu tiền
vé máy bay từ mỹ đi việt nam
từ nhật bản về việt nam bao nhiêu tiền
bao giờ có chuyến bay từ đức về việt nam
vé máy bay từ canada về việt nam giá rẻ
vé máy bay từ hàn quốc về việt nam
chuyến bay chuyên gia về việt nam