Infrastructure data project
Preparation of the Database
- Create the database on your local instance
- The name of the database should be the name of the project you can verify the connection string in the appsettings.json file and the declined files by environment
- Rename and modify the appsetting file
- appsettings.Example_Development.json => appsettings.Development.json
- if needed rename the server localhost to your local server name
- Launch the Package Manager Console in VS 2022 (Tools > Nuget Package Manager > Package Manager Console).
- Be sure to have the project [YourCompanyName].[YourProjectName].Infrastructure.Data selected as the Default Project in the console and the project [YourCompanyName].[YourProjectName].Presentation.Api as the Startup Project of your solution.
- (ONLY if no migration have been done = new project or never use) Run the Add-Migration command to initialize the migrations for the database project.
Add-Migration [nameOfYourMigration] -Context "DataContext"
- Run the Update-Database command to update you database schema (you can check if everything is fine in SQL Server Management Studio).
Update-Database -Context "DataContext"
- (OPTIONALLY) Update the Roles section in the bianetconfig.json file and the declined files by environment to use the correct AD groups or the Fakes roles.
- (OPTIONALLY) Update the version of the application. To do this, change the variable: TheBIADevCompany.[ProjectName].Crosscutting.Common.Constants.Application.Version.