Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Generate db context and models for local SQL Server database named "Task06", in folder "Models"
- dotnet ef dbcontext scaffold "server=.;Database=Task06;Trusted_Connection=True;TrustServerCertificate=True" Microsoft.EntityFrameworkCore.SqlServer -o Models
- # Generate db context named "Task06CtxNew" and its models (db "Task06", folder "ModelsNew"), and overwrite if it exists
- dotnet ef dbcontext scaffold "server=.;Database=Task06;Trusted_Connection=True;TrustServerCertificate=True" Microsoft.EntityFrameworkCore.SqlServer -o ModelsNew --context Task06CtxNew --force
- # Same as the last command, but use data annotations instead of fluent validation
- dotnet ef dbcontext scaffold "server=.\MSSQL2022;Database=Task06;Trusted_Connection=True;TrustServerCertificate=True" Microsoft.EntityFrameworkCore.SqlServer -o ModelsNew --context Task06CtxNew --force --data-annotations
- # Use following flags to...
- # --no-build ... avoid rebuild
- # --verbose ... get diagnostic messages
- # --help ... print usage info
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement