Skip to content

Straight conversion to .NET 8 #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7264168
Codeblocks: highlighting
Jul 19, 2019
427a828
HTML Entities: Encode them
Jul 19, 2019
e3253eb
HTML Entities: Encode them (#2)
csharpfritz Jul 30, 2019
6c20f3f
Codeblocks: highlighting improvements for blazor sections (#1)
csharpfritz Jul 30, 2019
61e026b
Merge branch 'master' of https://github.com/dotnet-presentations/blaz…
csharpfritz Nov 18, 2019
aaa0dad
Merge branch 'dotnet-presentations-master'
csharpfritz Nov 18, 2019
3f1bc43
Update docs/04-refactor-state-management.md
danroth27 Mar 21, 2020
5cb49aa
Merge branch 'master' into master
danroth27 Mar 21, 2020
d734463
Merge branch 'master' of https://github.com/dotnet-presentations/blaz…
csharpfritz May 22, 2020
95a7db1
Updated to 3.2
csharpfritz May 22, 2020
c017f57
Grammar in docs
thompcd Jun 28, 2020
34f4ca6
Merged June updates
csharpfritz Jul 26, 2020
09967a7
Merge branch 'release/5.0' of https://github.com/dotnet-presentations…
csharpfritz Dec 2, 2020
4ba0768
Merge pull request #5 from thompcd/patch-1
csharpfritz Dec 2, 2020
8d555e5
Merge branch 'dotnet-presentations:master' into master
csharpfritz Jul 2, 2021
a7855f7
Added devcontainer
csharpfritz Jul 2, 2021
31860be
Merge branch 'master' of github.com:csharpfritz/blazor-workshop
csharpfritz Jul 2, 2021
961d34b
Merge branch 'dotnet-presentations:main' into main
csharpfritz Dec 1, 2023
08fad77
Updated to NET 8
csharpfritz Dec 3, 2023
25d5b69
Fixed compiled models references for .NET 8
csharpfritz Dec 4, 2023
c177b2e
Updated to .NET 8
csharpfritz Apr 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/dotnet/.devcontainer/base.Dockerfile

# [Choice] .NET version: 5.0, 3.1, 2.1
ARG VARIANT="5.0"
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT}

# [Option] Install Node.js
ARG INSTALL_NODE="false"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Option] Install Azure CLI
ARG INSTALL_AZURE_CLI="false"
COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/
RUN if [ "$INSTALL_AZURE_CLI" = "true" ]; then bash /tmp/library-scripts/azcli-debian.sh; fi \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
56 changes: 56 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/dotnet
{
"name": "C# (.NET)",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update 'VARIANT' to pick a .NET Core version: 2.1, 3.1, 5.0
"VARIANT": "5.0",
// Options
"INSTALL_NODE": "true",
"NODE_VERSION": "lts/*",
"INSTALL_AZURE_CLI": "false"
}
},

// Set *default* container specific settings.json values on container create.
"settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5000, 5001],

// [Optional] To reuse of your local HTTPS dev cert:
//
// 1. Export it locally using this command:
// * Windows PowerShell:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
// * macOS/Linux terminal:
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
//
// 2. Uncomment these 'remoteEnv' lines:
// "remoteEnv": {
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
// },
//
// 3. Do one of the following depending on your scenario:
// * When using GitHub Codespaces and/or Remote - Containers:
// 1. Start the container
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
//
// * If only using Remote - Containers with a local container, uncomment this line instead:
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "dotnet restore",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
34 changes: 34 additions & 0 deletions .devcontainer/library-scripts/azcli-debian.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------
#
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/azcli.md
# Maintainer: The VS Code and Codespaces Teams
#
# Syntax: ./azcli-debian.sh

set -e

if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi

export DEBIAN_FRONTEND=noninteractive

# Install curl, apt-transport-https, lsb-release, or gpg if missing
if ! dpkg -s apt-transport-https curl ca-certificates lsb-release > /dev/null 2>&1 || ! type gpg > /dev/null 2>&1; then
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
apt-get update
fi
apt-get -y install --no-install-recommends apt-transport-https curl ca-certificates lsb-release gnupg2
fi

# Install the Azure CLI
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list
curl -sL https://packages.microsoft.com/keys/microsoft.asc | (OUT=$(apt-key add - 2>&1) || echo $OUT)
apt-get update
apt-get install -y azure-cli
echo "Done!"
10 changes: 5 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project>
<PropertyGroup>
<AspNetCoreVersion>7.0.0</AspNetCoreVersion>
<BlazorVersion>7.0.0</BlazorVersion>
<EntityFrameworkVersion>7.0.0</EntityFrameworkVersion>
<TargetFrameworkVersion>net7.0</TargetFrameworkVersion>
<SystemNetHttpJsonVersion>7.0.0</SystemNetHttpJsonVersion>
<AspNetCoreVersion>8.0.0</AspNetCoreVersion>
<BlazorVersion>8.0.0</BlazorVersion>
<EntityFrameworkVersion>8.0.0</EntityFrameworkVersion>
<TargetFrameworkVersion>net8.0</TargetFrameworkVersion>
<SystemNetHttpJsonVersion>8.0.0</SystemNetHttpJsonVersion>
</PropertyGroup>
</Project>
37 changes: 13 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
# Blazor - app building workshop
# BlazingPizzaWorkshop
The Blazing Pizza Workshop, updated for .NET 8

Welcome to the Blazor app building workshop!
Updated and derived from https://github.com/csharpfritz/blazor-workshop

Blazor is a single-page app framework for building client-side web apps using .NET and WebAssembly. In this workshop we will build a complete Blazor app and learn about the various Blazor framework features along the way.
Watch the videos that accompany this at: https://www.youtube.com/watch?v=sWTpxFcHbfY&list=PLdo4fOcmZ0oXv32dOd36UydQYLejKR61R&index=78

![Blazing Pizza](https://user-images.githubusercontent.com/1874516/77244515-c889ce00-6bd2-11ea-9a45-47452c084464.png)
Here are the list of modules that accompany this workshop:


## Getting Started

Go ahead and clone this repo to your machine, then dive in and [get started](/docs/00-get-started.md)!

## Sessions

| Session | Topics |
| ----- | ---- |
| [Session #0](/docs/00-get-started.md) | Get bits installed and build your first Blazor app |
| [Session #1](/docs/01-components-and-layout.md) | Get started with components, create the app layout |
| [Session #2](/docs/02-customize-a-pizza.md) | Add customized pizzas to orders |
| [Session #3](/docs/03-show-order-status.md) | Show order status |
| [Session #4](/docs/04-refactor-state-management.md) | Refactor state management |
| [Session #5](/docs/05-checkout-with-validation.md) | Checkout with validation |
| [Session #6](/docs/06-authentication-and-authorization.md) | Authenticate users and authorize access to order status |
| [Session #7](/docs/07-javascript-interop.md) | Track order status on a real time map |
| [Session #8](/docs/08-templated-components.md) | Create and use components with template parameters |
| [Session #9](/docs/09-progressive-web-app.md) | Progressive Web App (PWA) features |
| [Session #10](/docs/10-publish-and-deploy.md) | Deploy your app to Azure |
| Title |
| --- |
| [Get Started with Blazor](docs/00-get-started.md) |
| [Building our first home screen and learning about interactivity](docs/01-HomeScreen.md) |
| [Our first component and Managing State](docs/02-managing-state.md) |
| [Validating Data](docs/03-validation.md) |
| [Authenticating Users with Blazor](docs/04-authentication.md) |
| [Sharing Components with other projects](docs/05-components.md) |
2 changes: 1 addition & 1 deletion docs/00-get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ To get started with Blazor, follow the getting instructions on [blazor.net](http

Once you have your first Blazor app running, try [building a Blazor todo list app](https://aka.ms/blazor/todo).

Next up - [Components and layout](01-components-and-layout.md)
Next up - [Starting our app, the Home Screen, and more](01-HomeScreen.md)
Loading