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

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.

主站蜘蛛池模板: 巴彦淖尔市| 广德县| 德惠市| 龙里县| 屯留县| 三河市| 龙井市| 牡丹江市| 海口市| 中方县| 黄浦区| 奉化市| 江山市| 洪泽县| 尚志市| 白银市| 错那县| 四会市| 来安县| 西青区| 剑川县| 临汾市| 久治县| 林州市| 柞水县| 永顺县| 两当县| 师宗县| 呼伦贝尔市| 平远县| 南川市| 阿勒泰市| 乾安县| 九龙坡区| 阿克| 巴彦淖尔市| 瓮安县| 新巴尔虎右旗| 仲巴县| 醴陵市| 荆门市|