Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 1.35 KB

README.output.md

File metadata and controls

54 lines (35 loc) · 1.35 KB

Vertical Slice Minimal Api

Getting Started

  • Todo: Add custom getting started steps

Configuration

Configure the application using appsettings.json, appsettings.Development.json or dotnet secrets

dotnet user-secrets init --project src/Api

How to Run

To start the app run:

dotnet run --project src/Api

Database

When you run the application the database will be created (if it doesn't exist) and the migrations will be applied.

To run the migrations you will need to add the following flags to your ef commands.

  • -p | --project src/Application
  • -s | --startup-project src/Api
  • -o | --output-dir Infrastructure/Persistance/Migrations

For example, to add a new migration:

dotnet ef migrations add \
  -p src/Application \
  -s src/Api \
  -o Infrastructure/Persistance/Migrations "MigrationName"
dotnet ef migrations add -p src/Application -s src/Api -o Infrastructure/Persistance/Migrations "MigrationName"

Auth

Generate a bearer token using dotnet user-jwts with optional roles and policies

dotnet user-jwts create
dotnet user-jwts create --role "Administrator"