Skip to content

Simple Web App MVC (C#, ASP.NET 9.0, MVC, Entity Framework ORM, Identity)

License

Notifications You must be signed in to change notification settings

adamajammary/simple-web-app-mvc-dotnet

Repository files navigation

simple-web-app-mvc-dotnet

Simple Web App MVC (C#, ASP.NET 9.0, MVC, Entity Framework ORM, Identity)

GCP (Google Cloud Platform)

https://dotnet.gcp.jammary.com/

How to get started locally

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

Database Migration

https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli#create-your-database-and-schema

Visual Studio Package Manager Console (PMC)

Apply the Database migration in PMC.

Update-Database

Entity Framework Core .NET CLI

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

Visual Studio

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).

About

Simple Web App MVC (C#, ASP.NET 9.0, MVC, Entity Framework ORM, Identity)

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published