Skip to content

The Microsoft Contoso University sample web app demonstrates how to create an ASP.NET Core Razor Pages app using Entity Framework (EF) Core.

License

Notifications You must be signed in to change notification settings

Amondale/contoso-university-razor-pages

 
 

Repository files navigation

Contoso University Razor Project

The Microsoft Contoso University sample web app demonstrates how to create an ASP.NET Core Razor Pages app using Entity Framework (EF) Core. The project is based upon the tutorial on docs.microsoft.com. The projects that I will creating be refactored to reflect the clean architecture pattern using a pragmatic approach to software development. SOLID design principles and fundamental OOP will be used.

Thanks to folks like @ardalis, @EduardoPires, @garymcleanhall, & @jbogard for sharing lots of great patterns in their various GitHub repos & projects!

Getting Started

Use these instructions to get the project up and running.

Prerequisites

You will need the following tools:

Environment Setup

  1. Clone or fork the project
  2. Open the master branch
  3. Create a new SQL Database (preferrably named ContosoUniversity).
  4. In the database_package folder, open ContosoUniversity_Database_Package.sql using your preferred .sql file editor.
  5. Update the DatabaseName in line 34 to the database name created in step 3 and close the file.

  6. Back in Windows Explorer, enter CMD in the address bar and press the Enter key which will open a command prompt window. If command prompt is blocked then enter POWERSHELL in the address bar and press the Enter key which will open a PowerShell window.
    • Note: The path should be defaulted to the database_package folder.
  7. Paste the following code and press the enter key to deploy the databse code.
    sqlcmd.exe -b -S "MICK" -o ".\contosouniversity.txt" -i ".\ContosoUniversity_Database_Package.sql"
    
  8. Back in Winodws Explorer, open the output file named contosouniversity.txt to verify that the database was created successfully.
  9. In Visual Studio, open the ContosoUniverity.sln, navigate to the ContosoUniversity.Web project, edit the appsettings.json file setting the proper database and server name.

Database Diagram

A database diagram to help with understanding my take on this project is located here: ContosoUniversityDatabaseDiagram

Technologies

  • .NET Core 3.0
  • ASP.NET Core 3.0
  • Entity Framework Core 3.0

Packages Utilized

License

This project is licensed under the MIT License.

About

The Microsoft Contoso University sample web app demonstrates how to create an ASP.NET Core Razor Pages app using Entity Framework (EF) Core.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 58.6%
  • C# 20.9%
  • HTML 10.0%
  • TSQL 9.9%
  • CSS 0.6%