![]() You can download the completed project from See project source You can build the application by following the steps in a series of See the In Pages/Index.cshtml, replace the contents of the file with the following code: = "Home page" Ĭontoso University is a sample application thatĭemonstrates how to use Entity Framework Core in an Entries are added for About, Students, Courses, Instructors, and Departments.The Home and Privacy menu entries are deleted.Each occurrence of "ContosoUniversity" to "Contoso University".The preceding code makes the following changes: The layout file sets the site header, footer, and menu. Run the following commands to create a Razor Pages project and cd into the new project folder: dotnet new webapp -o ContosoUniversityĬopy and paste the following code into the Pages/Shared/_Layout.cshtml file: - Contoso UniversityĬontoso 2021 - Contoso University - RenderSectionAsync("Scripts", required: false) In a terminal, navigate to the folder in which the project folder should be created. NET 6.0 (Long-term support) and then select Create. In the Additional information dialog, select. It's important to name the project ContosoUniversity, including matching the capitalization, so the namespaces will match when you copy and paste example code. In the Configure your new project dialog, enter ContosoUniversity for Project name. In the Create a new project dialog, select ASP.NET Core Web App, and then select Next. Start Visual Studio 2022 and select Create a new project. If you run into a problem you can't resolve, compare your code to the completed project. Building the completed app is recommended when you have problems you can't solve. The tutorial's focus is on how to use EF Core with ASP.NET Core, not how to customize the UI. The UI style of this site is based on the built-in project templates. ![]() Here are a few of the screens created in the tutorial. ![]() Users can view and update student, course, and instructor information. The app built in these tutorials is a basic university web site. A good way to get help is by posting a question to, using the ASP.NET Core tag or the EF Core tag. The Visual Studio Code tab use SQLite, a cross-platform database engine. Minor changes may be required if you use something other than Visual Studio Code.Ĭonsider downloading and installing a third-party tool for managing and viewing a SQLite database, such as DB Browser for SQLite. You can follow these instructions on macOS, Linux, or Windows and with any code editor. NET CLI for ASP.NET Core development functions such as project creation. The Visual Studio Code instructions use the. C# for Visual Studio Code (latest version).The Visual Studio instructions use SQL Server LocalDB, a version of SQL Server Express that runs only on Windows. Visual Studio 2022 with the ASP.NET and web development workload.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |