Skip to content

Example .NET Core 3.1 project with connection to PostgreSQL database

Notifications You must be signed in to change notification settings

mszymczakowski/example-net-core-postgresql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example-net-core-postgresql

Example .NET Core 3.1 project with xUnit and connection to PostgreSQL database.

Requirements:

  • PostgreSQL database
  • .NET Core 3.1 SDK

Start example database

Use this only if you don't have existing PostgreSQL database.

  1. Change directory to the docker directory
    • Command:
      cd docker
  2. Run docker-compose
    • Command:
      docker-compose up

EntityFramework database scaffold

  1. Change directory to the project folder
    • Command:
      cd src/ExampleSolution.Db
  2. Scaffold the database
    • Command:
      dotnet ef dbcontext scaffold "Host=my_host;Database=my_db;Username=my_user;Password=my_pw" Npgsql.EntityFrameworkCore.PostgreSQL -c MyDbContext -o Models --context-dir .

Additional info:

About

Example .NET Core 3.1 project with connection to PostgreSQL database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published