Skip to content

Instantly share code, notes, and snippets.

@alefra88
Last active February 5, 2025 03:29
Show Gist options
  • Save alefra88/9522ba1ff8c7451eb2a9c595b8e96c8f to your computer and use it in GitHub Desktop.
Save alefra88/9522ba1ff8c7451eb2a9c595b8e96c8f to your computer and use it in GitHub Desktop.
SCAFOLD
Scaffold-DbContext "Server=LAPTOP-S8HOTDC5\SQLEXPRESS;Database=Empresa1;User ID=sa; password=dbdev; TrustServerCertificate=True;" Microsoft.EntityFrameWorkCore.SqlServer -Tables "dbo.T_EMPLEADOS","dbo.T_CAT_PUESTO" -Context EmpresaContext -ContextDir Models -OutputDir Models -NoPluralize -Force
/*Inyectar Connection string a program*/
builder.Services.AddDbContext<DBTESTContext>(opcion =>
{
opcion.UseSqlServer(builder.Configuration.GetConnectionString("dbCon"));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment