官术网_书友最值得收藏!

The File menu

From the File menu, perform the following steps:

  1. Select NewProject.
  2. On the left pane, select Templates | Visual C# | .NET Core.
  3. Select the ASP.NET Core Web Application template from the list.
  1. As displayed in the previous screenshot, enter MasteringEFCore.CodeFirst.Starter as the Name and MasteringEFCore as the Solution name and click OK.

Irrespective of the previous two approaches, the selected template will provide New ASP.NET Web Application (.NET Core) dialog, to let us choose from the following:

    • Empty
    • Web API: Creates a Web API project
    • Web Application (Model-View-Controller): Creates an MVC Web application which also allows us to create APIs

We will be selecting Web Application (Model-View-Controller) from the dialog as shown here:

New ASP.NET web project dialog

  1. In our case, select .NET CoreASP.NET Core 2.0, and the Web Application (Model-View-Controller) template, and also keep the Authentication set to No Authentication. Click OK:

ASP.NET Core web application

The generated web application displays a tabbed interface which is new to us (instead of displaying index.cshtml). It allows us to access documentation, connect to any service or even decide on publishing options right from the start page.

If we look closely, we will notice that Visual Studio was silently restoring the packages, and almost everything was part of a package in .NET Core. No more heavyweight framework which always loads tons of DLLs even though we don't require them! Now everything is broken into lighter packages which we could utilize based on our requirements.

I know getting into MVC would be a little outside of the scope of this chapter, but let's dig into a few details before we deep pe into the Entity Framework.

主站蜘蛛池模板: 黑河市| 岐山县| 太湖县| 武功县| 获嘉县| 辽宁省| 安乡县| 四平市| 分宜县| 肃南| 金乡县| 富裕县| 康保县| 潞西市| 扶风县| 贞丰县| 东乌珠穆沁旗| 大同县| 枣强县| 海口市| 威海市| 冕宁县| 榆社县| 来宾市| 大同市| 斗六市| 阿拉善左旗| 永昌县| 南澳县| 宣恩县| 射阳县| 朝阳县| 宜良县| 抚松县| 察哈| 浠水县| 无锡市| 古田县| 庄河市| 贵阳市| 闸北区|