Simple Web App MVC (C#, ASP.NET 9.0, MVC, Entity Framework ORM, Identity)
https://dotnet.gcp.jammary.com/
Clone the git repo.
git clone https://github.com/adamajammary/simple-web-app-mvc-dotnet.git
Create a new appsettings file for local development.
cp -f "SimpleWebAppMVC\appsettings.json" "SimpleWebAppMVC\appsettings.Development.json"
Update your new appsettings file.
{
"UseMySQL": false,
"ConnectionStrings": {
"DbConnection": "Server=(localdb)\\mssqllocaldb;Trusted_Connection=True;Database=SimpleWebAppMVC"
},
"Token": {
"Audience": "http://localhost:57968/",
"Issuer": "http://localhost:57968/",
"Key": "d8fd8fb0-2dcb-4b12-892f-2eab015f246a"
},
}
Change working directory to the SimpleWebAppMVC
project.
cd SimpleWebAppMVC
Check if dependent nuget packages are installed.
dotnet list package
Install dependent nuget packages (if necessary).
dotnet restore
Apply the Database migration in PMC.
Update-Database
Install the CLI tools (if not already installed).
https://learn.microsoft.com/en-us/ef/core/cli/dotnet#installing-the-tools
dotnet tool install --global dotnet-ef
Apply the Database migration using the CLI.
dotnet ef database update
When you start the project in Visual Studio you will be asked to trust the IIS Express SSL certificate for Hot Reload purposes. You can choose to install the root certificate if you want, but it's not necessary to run the project in Development mode (since it uses HTTP and no SSL certificate is needed).