Domain Driven Design
- Install or Update GIT
- Install or Update Docker
- Install or update the .NET Core 3.1 LTS SDK
- Install or Update VSCode or Visual-Studio, or your favorite code editor for C#
cd $mygitroot
git clone https://github.com/Magenic/DDD.git
cd DDD
In the docker settings, add the DDD/Data
folder to the Settings/Resources/File Sharing
Apply and restart docker!
- Code/ - Code
- Data/ - Data and helpers
- Scripts/ - Docker Scripts to spin up/down SQL Server for code demos
All of the script are designed to be used with GIT-BASH
The sample code will use a linix based Docker container image of Microsoft SQL Server 2017 where the port for sql of 1433 is remapped to 1466 to avoid colliding with any local instances you may have.
If you need to modify the scripts to suit your particular needs you can modify the environment variables as desired.
Start by changing directory to scripts/
cd scripts
./start-sql.sh
2017-CU21-ubuntu-16.04: Pulling from mssql/server
Digest: sha256:586a0e2535f191c59ff7b9aa1a70ae03bac0747ef0d2021cdea24326bcf2c3e4
Status: Image is up to date for mcr.microsoft.com/mssql/server:2017-CU21-ubuntu-16.04
mcr.microsoft.com/mssql/server:2017-CU21-ubuntu-16.04
4a771b7bf116b9b0acdbb6ecd005346a7163f31d48520ddbcaca1e08cd4a546b
SQL Running on Port: 1466
Info: SQL Server takes a while to start, so give it a few minutes to get up and running
This will install and start SQL:
- Address:
localhost,1466
- Username:
sa
- Password:
ddd20demoSQL-
- Port:
1466
Docker Info:
- Container Name:
ddd-sql
- Image:
mcr.microsoft.com/mssql/server:2017-CU21-ubuntu-16.04
./stop-sql.sh
Warning: You will be
root
./cli-bash.sh
#
Use exit
to close the shell
This will open the command line SQLCMD prompt:
./prompt-sql.sh
1>
Use exit
to close the shell
var connectionString = "Server=localhost,1466;Database={Insert DB Name here};User Id=sa;Password=ddd20demoSQL-;"
If you want to use SSMS
Stuart Williams Larry Smithmier Rocky Lhotka