Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 955 Bytes

Dotnet_cheatsheet.md

File metadata and controls

39 lines (25 loc) · 955 Bytes

Dotnet cheatsheet

Installation

Install ef-tools

dotnet tool install dotnet-ef -g

Database

Add migration

dotnet ef migrations add MigrationName -p Nellebot.Data.Migrations

Remove last migration

dotnet ef migrations remove -p Nellebot.Data.Migrations

Update dev database

dotnet ef database update -p Nellebot.Data.Migrations

Update to target migration

dotnet ef database update TargetMigration -p Nellebot.Data.Migrations

Generate database upgrade script

dotnet ef migrations script --idempotent -o database_migration.sql -p Nellebot.Data.Migrations

Publish

Publish windows release

dotnet publish -c Release -r win10-x64 --self-contained false

Publish linux release

dotnet publish -c Release -r linux-x64 --self-contained false

User secrets

List secrets

dotnet user-secrets list

Set secrets for local development

dotnet user-secrets set "SECRET_NAME" "SECRET_VALUE"​