Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Latest commit

 

History

History
47 lines (26 loc) · 2.5 KB

File metadata and controls

47 lines (26 loc) · 2.5 KB

GRA 4 Developer Documentation - Initial developer setup

Development environment

The project has been migrated to use Visual Studio 2017 .csproj files and no longer uses the project.json project files as in Visual Studio 2015.

Initial developer setup

Due to the constantly changing data model the project currently does not yet ship with a database migration in place. You must run the command below to set up an initial migration.

The project ships with the Microsoft SQL Server data provider configured. If you are running in a Windows environment this will automatically use a LocalDB instance under (localdb)\mssqllocaldb. In a Linux/macOS environment you should switch to the SQLite provider (in appsettings.json change the GraConnectionStringName to "SQLite").

Database migration

Initial database setup and configuration can be done utilizing the dotnet ef command line tool or the Package Manager Console. Here are steps for using dotnet ef:

  1. Navigate to the appropriate project directory for your database provider (e.g. src/GRA.Data.SqlServer or src/GRA.Data.SQLite).
  2. Check if a database migration exists:
`dotnet ef -s ../GRA.Web migrations list`
  1. If no migrations exist, create one:
`dotnet ef -s ../GRA.Web migrations add initial`
  1. Create or update the database to the migration (necessary for SQLite, possibly not for SQL Server but won't hurt):
`dotnet ef -s ../GRA.Web database update`

Configuration

The GRA.Web project has the Secret Manager enabled. You may want to issue a command such as:

  dotnet user-secrets set GraEmailOverride your@email.address

To ensure that no errant emails are sent out during development. There are other settings you may want to configure through this manner such as GraDefaultOutgoingMailHost and GraDefaultOutgoingMailPort. Review Startup.cs for more configuration settings.

Run the application!

At this point you should be able to run the application in the debugger.