User Tools

Site Tools


dev:csharp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:csharp [2024/12/08 03:22] – [entityframework (my beloved)] adamdev:csharp [2024/12/08 03:53] (current) – [entityframework (my beloved)] adam
Line 78: Line 78:
  
 ======= entityframework (my beloved) ======= ======= entityframework (my beloved) =======
 +
 +install in your dev env:
 +
 +  dotnet tool install --global dotnet-ef
  
 install packages: install packages:
   * Microsoft.EntityFrameworkCore.Design   * Microsoft.EntityFrameworkCore.Design
   * Npgsql.EntityFrameworkCore.PostgreSQL (or whatever you like)   * Npgsql.EntityFrameworkCore.PostgreSQL (or whatever you like)
 +
 +  dotnet-ef dbcontext scaffold "Host=HOST;Database=DBNAME;Username=USERNAMEPassword=PASSWORD;IncludeErrorDetail=true;" Npgsql.EntityFrameworkCore.PostgreSQL
 +
  
 migrations: migrations:
-    dotnet ef migrations add "name of migration" +  dotnet ef migrations add "name of migration" 
-    dotnet ef database update --connection "Host=asdfasdfasdf etc" +  dotnet ef database update --connection "Host=asdfasdfasdf etc" 
-    +
 ======= enum names ======= ======= enum names =======
  
dev/csharp.1733628136.txt.gz · Last modified: 2024/12/08 03:22 by adam