A collection of commands useful to work with blazor web applications.
- Create a new application.
dotnet new blazor -o BlazorWebAppMovies
- Compile and run the application, and hot-reload upon changes.
dotnet watch
- VS Code build:
Command Palette (Ctrl+Shift+P), use the .NET: Build command to build the app.
- Create gitignore file:
dotnet new gitignore
dotnet aspnet-codegenerator blazor CRUD -dbProvider sqlite -dc BlazorWebAppMovies.Data.BlazorWebAppMoviesContext -m Movie -outDir Components/Pages
Entity framework
- Create a migration, this is also used when creating a new migration when the model has changed.
dotnet ef migrations add InitialCreate
- Update the database:
dotnet ef database update