- Backend API for Real Estate listing website built using .NET 6 Web API and Entity Framework Core
-
Setup Docker
-
Create a new file called .env and copy the contents of example-env into it or simply rename env.example to .env
-
Open up a terminal in this directory and build the web api image
docker build -t realestateapp-api .
- Create and run the containers
docker compose up
- The app will automatically apply migrations and seed the database if the ApplyMigrationsOnBoot environment variable is set to "Y"
- Connection strings, passwords and default admin credentials can be set via the .env file.
Add migrations via the package manager console
Add-Migration -Context RealEstateContext version_name
Add-Migration -Context RealEstateIdentityContext version_name
Apply the migrations to the database
Update-Database -Context RealEstateContext
Update-Database -Context RealEstateIdentityContext