Blog Project for Learning .Net Core WebAPI

Install .Net Tools EF(Entity Framework) Core

dotnet tool update --global dotnet-ef
dotnet add package Microsoft.Extensions.Configuration
dotnet add package Microsoft.Extensions.Configuration.UserSecrets
dotnet user-secrets init
dotnet user-secrets set ConnectionStrings:BlogCon "Host=localhost;Database=my_blog;Username=postgres;Password=postgres"

Replace the values in the connection string as per your local environment setup

Generate Migration Scafolds

dotnet ef migrations add InitialSchema

Create database tables and seed data

dotnet ef database update

Run the application

dotnet watch run