├── .gitignore ├── LICENSE ├── README.md ├── THIRD-PARTY-NOTICES.md ├── docs ├── 00-get-started.md ├── 01-components-and-layout.md ├── 02-customize-a-pizza.md ├── 03-show-order-status.md ├── 04-refactor-state-management.md ├── 05-authentication-and-authorization.md ├── 06-javascript-interop.md ├── 07-templated-components.md └── 08-publish-and-deploy.md ├── notes ├── outline.md └── speaker-notes.md ├── save-points ├── 00-Starting-point │ ├── BlazingPizza.Client │ │ ├── App.cshtml │ │ ├── BlazingPizza.Client.csproj │ │ ├── Pages │ │ │ ├── Index.cshtml │ │ │ └── _ViewImports.cshtml │ │ ├── Program.cs │ │ ├── Shared │ │ │ └── MainLayout.cshtml │ │ ├── Startup.cs │ │ ├── _ViewImports.cshtml │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── font │ │ │ │ ├── quicksand-v8-latin-300.woff │ │ │ │ ├── quicksand-v8-latin-300.woff2 │ │ │ │ ├── quicksand-v8-latin-500.woff │ │ │ │ ├── quicksand-v8-latin-500.woff2 │ │ │ │ ├── quicksand-v8-latin-700.woff │ │ │ │ ├── quicksand-v8-latin-700.woff2 │ │ │ │ ├── quicksand-v8-latin-regular.woff │ │ │ │ ├── quicksand-v8-latin-regular.woff2 │ │ │ │ └── quicksand.css │ │ │ └── site.css │ │ │ ├── img │ │ │ ├── bike.svg │ │ │ ├── logo.svg │ │ │ ├── pizza-slice.svg │ │ │ ├── pizzas │ │ │ │ ├── bacon.jpg │ │ │ │ ├── brit.jpg │ │ │ │ ├── cheese.jpg │ │ │ │ ├── margherita.jpg │ │ │ │ ├── meaty.jpg │ │ │ │ ├── mushroom.jpg │ │ │ │ ├── pepperoni.jpg │ │ │ │ └── salad.jpg │ │ │ └── user.svg │ │ │ └── index.html │ ├── BlazingPizza.ComponentsLibrary │ │ ├── Authentication │ │ │ ├── UserState.cs │ │ │ └── UserStateProvider.cshtml │ │ ├── BlazingPizza.ComponentsLibrary.csproj │ │ ├── Map │ │ │ ├── Map.cshtml │ │ │ ├── Marker.cs │ │ │ └── Point.cs │ │ └── content │ │ │ ├── authPopup.js │ │ │ ├── deliveryMap.js │ │ │ └── leaflet │ │ │ ├── images │ │ │ ├── layers-2x.png │ │ │ ├── layers.png │ │ │ ├── marker-icon-2x.png │ │ │ ├── marker-icon.png │ │ │ └── marker-shadow.png │ │ │ ├── leaflet.css │ │ │ └── leaflet.js │ ├── BlazingPizza.Server │ │ ├── BlazingPizza.Server.csproj │ │ ├── OrdersController.cs │ │ ├── PizzaStoreContext.cs │ │ ├── PizzasController.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── SeedData.cs │ │ ├── SpecialsController.cs │ │ ├── Startup.cs │ │ ├── ToppingsController.cs │ │ ├── UserController.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── BlazingPizza.Shared │ │ ├── BlazingPizza.Shared.csproj │ │ ├── LatLong.cs │ │ ├── Order.cs │ │ ├── OrderWithStatus.cs │ │ ├── Pizza.cs │ │ ├── PizzaSpecial.cs │ │ ├── PizzaTopping.cs │ │ └── Topping.cs │ └── BlazingPizza.sln ├── 01-Components-and-layout │ ├── BlazingPizza.Client │ │ ├── App.cshtml │ │ ├── BlazingPizza.Client.csproj │ │ ├── Pages │ │ │ ├── Index.cshtml │ │ │ └── _ViewImports.cshtml │ │ ├── Program.cs │ │ ├── Shared │ │ │ └── MainLayout.cshtml │ │ ├── Startup.cs │ │ ├── _ViewImports.cshtml │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── font │ │ │ │ ├── quicksand-v8-latin-300.woff │ │ │ │ ├── quicksand-v8-latin-300.woff2 │ │ │ │ ├── quicksand-v8-latin-500.woff │ │ │ │ ├── quicksand-v8-latin-500.woff2 │ │ │ │ ├── quicksand-v8-latin-700.woff │ │ │ │ ├── quicksand-v8-latin-700.woff2 │ │ │ │ ├── quicksand-v8-latin-regular.woff │ │ │ │ ├── quicksand-v8-latin-regular.woff2 │ │ │ │ └── quicksand.css │ │ │ └── site.css │ │ │ ├── img │ │ │ ├── bike.svg │ │ │ ├── logo.svg │ │ │ ├── pizza-slice.svg │ │ │ ├── pizzas │ │ │ │ ├── bacon.jpg │ │ │ │ ├── brit.jpg │ │ │ │ ├── cheese.jpg │ │ │ │ ├── margherita.jpg │ │ │ │ ├── meaty.jpg │ │ │ │ ├── mushroom.jpg │ │ │ │ ├── pepperoni.jpg │ │ │ │ └── salad.jpg │ │ │ └── user.svg │ │ │ └── index.html │ ├── BlazingPizza.ComponentsLibrary │ │ ├── Authentication │ │ │ ├── UserState.cs │ │ │ └── UserStateProvider.cshtml │ │ ├── BlazingPizza.ComponentsLibrary.csproj │ │ ├── Map │ │ │ ├── Map.cshtml │ │ │ ├── Marker.cs │ │ │ └── Point.cs │ │ └── content │ │ │ ├── authPopup.js │ │ │ ├── deliveryMap.js │ │ │ └── leaflet │ │ │ ├── images │ │ │ ├── layers-2x.png │ │ │ ├── layers.png │ │ │ ├── marker-icon-2x.png │ │ │ ├── marker-icon.png │ │ │ └── marker-shadow.png │ │ │ ├── leaflet.css │ │ │ └── leaflet.js │ ├── BlazingPizza.Server │ │ ├── BlazingPizza.Server.csproj │ │ ├── OrdersController.cs │ │ ├── PizzaStoreContext.cs │ │ ├── PizzasController.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── SeedData.cs │ │ ├── SpecialsController.cs │ │ ├── Startup.cs │ │ ├── ToppingsController.cs │ │ ├── UserController.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── BlazingPizza.Shared │ │ ├── BlazingPizza.Shared.csproj │ │ ├── LatLong.cs │ │ ├── Order.cs │ │ ├── OrderWithStatus.cs │ │ ├── Pizza.cs │ │ ├── PizzaSpecial.cs │ │ ├── PizzaTopping.cs │ │ └── Topping.cs │ └── BlazingPizza.sln ├── 02-customize-a-pizza │ ├── BlazingPizza.Client │ │ ├── App.cshtml │ │ ├── BlazingPizza.Client.csproj │ │ ├── Pages │ │ │ ├── Index.cshtml │ │ │ └── _ViewImports.cshtml │ │ ├── Program.cs │ │ ├── Shared │ │ │ ├── ConfigurePizzaDialog.cshtml │ │ │ ├── ConfiguredPizzaItem.cshtml │ │ │ └── MainLayout.cshtml │ │ ├── Startup.cs │ │ ├── _ViewImports.cshtml │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── font │ │ │ │ ├── quicksand-v8-latin-300.woff │ │ │ │ ├── quicksand-v8-latin-300.woff2 │ │ │ │ ├── quicksand-v8-latin-500.woff │ │ │ │ ├── quicksand-v8-latin-500.woff2 │ │ │ │ ├── quicksand-v8-latin-700.woff │ │ │ │ ├── quicksand-v8-latin-700.woff2 │ │ │ │ ├── quicksand-v8-latin-regular.woff │ │ │ │ ├── quicksand-v8-latin-regular.woff2 │ │ │ │ └── quicksand.css │ │ │ └── site.css │ │ │ ├── img │ │ │ ├── bike.svg │ │ │ ├── logo.svg │ │ │ ├── pizza-slice.svg │ │ │ ├── pizzas │ │ │ │ ├── bacon.jpg │ │ │ │ ├── brit.jpg │ │ │ │ ├── cheese.jpg │ │ │ │ ├── margherita.jpg │ │ │ │ ├── meaty.jpg │ │ │ │ ├── mushroom.jpg │ │ │ │ ├── pepperoni.jpg │ │ │ │ └── salad.jpg │ │ │ └── user.svg │ │ │ └── index.html │ ├── BlazingPizza.ComponentsLibrary │ │ ├── Authentication │ │ │ ├── UserState.cs │ │ │ └── UserStateProvider.cshtml │ │ ├── BlazingPizza.ComponentsLibrary.csproj │ │ ├── Map │ │ │ ├── Map.cshtml │ │ │ ├── Marker.cs │ │ │ └── Point.cs │ │ └── content │ │ │ ├── authPopup.js │ │ │ ├── deliveryMap.js │ │ │ └── leaflet │ │ │ ├── images │ │ │ ├── layers-2x.png │ │ │ ├── layers.png │ │ │ ├── marker-icon-2x.png │ │ │ ├── marker-icon.png │ │ │ └── marker-shadow.png │ │ │ ├── leaflet.css │ │ │ └── leaflet.js │ ├── BlazingPizza.Server │ │ ├── BlazingPizza.Server.csproj │ │ ├── OrdersController.cs │ │ ├── PizzaStoreContext.cs │ │ ├── PizzasController.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── SeedData.cs │ │ ├── SpecialsController.cs │ │ ├── Startup.cs │ │ ├── ToppingsController.cs │ │ ├── UserController.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── BlazingPizza.Shared │ │ ├── BlazingPizza.Shared.csproj │ │ ├── LatLong.cs │ │ ├── Order.cs │ │ ├── OrderWithStatus.cs │ │ ├── Pizza.cs │ │ ├── PizzaSpecial.cs │ │ ├── PizzaTopping.cs │ │ └── Topping.cs │ └── BlazingPizza.sln ├── 03-show-order-status │ ├── BlazingPizza.Client │ │ ├── App.cshtml │ │ ├── BlazingPizza.Client.csproj │ │ ├── Pages │ │ │ ├── Index.cshtml │ │ │ ├── MyOrders.cshtml │ │ │ ├── OrderDetails.cshtml │ │ │ └── _ViewImports.cshtml │ │ ├── Program.cs │ │ ├── Shared │ │ │ ├── ConfigurePizzaDialog.cshtml │ │ │ ├── ConfiguredPizzaItem.cshtml │ │ │ └── MainLayout.cshtml │ │ ├── Startup.cs │ │ ├── _ViewImports.cshtml │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── font │ │ │ │ ├── quicksand-v8-latin-300.woff │ │ │ │ ├── quicksand-v8-latin-300.woff2 │ │ │ │ ├── quicksand-v8-latin-500.woff │ │ │ │ ├── quicksand-v8-latin-500.woff2 │ │ │ │ ├── quicksand-v8-latin-700.woff │ │ │ │ ├── quicksand-v8-latin-700.woff2 │ │ │ │ ├── quicksand-v8-latin-regular.woff │ │ │ │ ├── quicksand-v8-latin-regular.woff2 │ │ │ │ └── quicksand.css │ │ │ └── site.css │ │ │ ├── img │ │ │ ├── bike.svg │ │ │ ├── logo.svg │ │ │ ├── pizza-slice.svg │ │ │ ├── pizzas │ │ │ │ ├── bacon.jpg │ │ │ │ ├── brit.jpg │ │ │ │ ├── cheese.jpg │ │ │ │ ├── margherita.jpg │ │ │ │ ├── meaty.jpg │ │ │ │ ├── mushroom.jpg │ │ │ │ ├── pepperoni.jpg │ │ │ │ └── salad.jpg │ │ │ └── user.svg │ │ │ └── index.html │ ├── BlazingPizza.ComponentsLibrary │ │ ├── Authentication │ │ │ ├── UserState.cs │ │ │ └── UserStateProvider.cshtml │ │ ├── BlazingPizza.ComponentsLibrary.csproj │ │ ├── Map │ │ │ ├── Map.cshtml │ │ │ ├── Marker.cs │ │ │ └── Point.cs │ │ └── content │ │ │ ├── authPopup.js │ │ │ ├── deliveryMap.js │ │ │ └── leaflet │ │ │ ├── images │ │ │ ├── layers-2x.png │ │ │ ├── layers.png │ │ │ ├── marker-icon-2x.png │ │ │ ├── marker-icon.png │ │ │ └── marker-shadow.png │ │ │ ├── leaflet.css │ │ │ └── leaflet.js │ ├── BlazingPizza.Server │ │ ├── BlazingPizza.Server.csproj │ │ ├── OrdersController.cs │ │ ├── PizzaStoreContext.cs │ │ ├── PizzasController.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── SeedData.cs │ │ ├── SpecialsController.cs │ │ ├── Startup.cs │ │ ├── ToppingsController.cs │ │ ├── UserController.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── BlazingPizza.Shared │ │ ├── BlazingPizza.Shared.csproj │ │ ├── LatLong.cs │ │ ├── Order.cs │ │ ├── OrderWithStatus.cs │ │ ├── Pizza.cs │ │ ├── PizzaSpecial.cs │ │ ├── PizzaTopping.cs │ │ └── Topping.cs │ └── BlazingPizza.sln ├── 04-refactor-state-management │ ├── BlazingPizza.Client │ │ ├── App.cshtml │ │ ├── BlazingPizza.Client.csproj │ │ ├── OrderState.cs │ │ ├── Pages │ │ │ ├── Index.cshtml │ │ │ ├── MyOrders.cshtml │ │ │ ├── OrderDetails.cshtml │ │ │ └── _ViewImports.cshtml │ │ ├── Program.cs │ │ ├── Shared │ │ │ ├── ConfigurePizzaDialog.cshtml │ │ │ ├── ConfiguredPizzaItem.cshtml │ │ │ └── MainLayout.cshtml │ │ ├── Startup.cs │ │ ├── _ViewImports.cshtml │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── font │ │ │ │ ├── quicksand-v8-latin-300.woff │ │ │ │ ├── quicksand-v8-latin-300.woff2 │ │ │ │ ├── quicksand-v8-latin-500.woff │ │ │ │ ├── quicksand-v8-latin-500.woff2 │ │ │ │ ├── quicksand-v8-latin-700.woff │ │ │ │ ├── quicksand-v8-latin-700.woff2 │ │ │ │ ├── quicksand-v8-latin-regular.woff │ │ │ │ ├── quicksand-v8-latin-regular.woff2 │ │ │ │ └── quicksand.css │ │ │ └── site.css │ │ │ ├── img │ │ │ ├── bike.svg │ │ │ ├── logo.svg │ │ │ ├── pizza-slice.svg │ │ │ ├── pizzas │ │ │ │ ├── bacon.jpg │ │ │ │ ├── brit.jpg │ │ │ │ ├── cheese.jpg │ │ │ │ ├── margherita.jpg │ │ │ │ ├── meaty.jpg │ │ │ │ ├── mushroom.jpg │ │ │ │ ├── pepperoni.jpg │ │ │ │ └── salad.jpg │ │ │ └── user.svg │ │ │ └── index.html │ ├── BlazingPizza.ComponentsLibrary │ │ ├── Authentication │ │ │ ├── UserState.cs │ │ │ └── UserStateProvider.cshtml │ │ ├── BlazingPizza.ComponentsLibrary.csproj │ │ ├── Map │ │ │ ├── Map.cshtml │ │ │ ├── Marker.cs │ │ │ └── Point.cs │ │ └── content │ │ │ ├── authPopup.js │ │ │ ├── deliveryMap.js │ │ │ └── leaflet │ │ │ ├── images │ │ │ ├── layers-2x.png │ │ │ ├── layers.png │ │ │ ├── marker-icon-2x.png │ │ │ ├── marker-icon.png │ │ │ └── marker-shadow.png │ │ │ ├── leaflet.css │ │ │ └── leaflet.js │ ├── BlazingPizza.Server │ │ ├── BlazingPizza.Server.csproj │ │ ├── OrdersController.cs │ │ ├── PizzaStoreContext.cs │ │ ├── PizzasController.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── SeedData.cs │ │ ├── SpecialsController.cs │ │ ├── Startup.cs │ │ ├── ToppingsController.cs │ │ ├── UserController.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── BlazingPizza.Shared │ │ ├── BlazingPizza.Shared.csproj │ │ ├── LatLong.cs │ │ ├── Order.cs │ │ ├── OrderWithStatus.cs │ │ ├── Pizza.cs │ │ ├── PizzaSpecial.cs │ │ ├── PizzaTopping.cs │ │ └── Topping.cs │ └── BlazingPizza.sln ├── 05-add-authentication │ ├── BlazingPizza.Client │ │ ├── App.cshtml │ │ ├── BlazingPizza.Client.csproj │ │ ├── OrderState.cs │ │ ├── Pages │ │ │ ├── Index.cshtml │ │ │ ├── MyOrders.cshtml │ │ │ ├── OrderDetails.cshtml │ │ │ └── _ViewImports.cshtml │ │ ├── Program.cs │ │ ├── Shared │ │ │ ├── ConfigurePizzaDialog.cshtml │ │ │ ├── ConfiguredPizzaItem.cshtml │ │ │ ├── ForceSignInLayout.cshtml │ │ │ ├── MainLayout.cshtml │ │ │ └── UserInfo.cshtml │ │ ├── Startup.cs │ │ ├── _ViewImports.cshtml │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── font │ │ │ │ ├── quicksand-v8-latin-300.woff │ │ │ │ ├── quicksand-v8-latin-300.woff2 │ │ │ │ ├── quicksand-v8-latin-500.woff │ │ │ │ ├── quicksand-v8-latin-500.woff2 │ │ │ │ ├── quicksand-v8-latin-700.woff │ │ │ │ ├── quicksand-v8-latin-700.woff2 │ │ │ │ ├── quicksand-v8-latin-regular.woff │ │ │ │ ├── quicksand-v8-latin-regular.woff2 │ │ │ │ └── quicksand.css │ │ │ └── site.css │ │ │ ├── img │ │ │ ├── bike.svg │ │ │ ├── logo.svg │ │ │ ├── pizza-slice.svg │ │ │ ├── pizzas │ │ │ │ ├── bacon.jpg │ │ │ │ ├── brit.jpg │ │ │ │ ├── cheese.jpg │ │ │ │ ├── margherita.jpg │ │ │ │ ├── meaty.jpg │ │ │ │ ├── mushroom.jpg │ │ │ │ ├── pepperoni.jpg │ │ │ │ └── salad.jpg │ │ │ └── user.svg │ │ │ └── index.html │ ├── BlazingPizza.ComponentsLibrary │ │ ├── Authentication │ │ │ ├── UserState.cs │ │ │ └── UserStateProvider.cshtml │ │ ├── BlazingPizza.ComponentsLibrary.csproj │ │ ├── Map │ │ │ ├── Map.cshtml │ │ │ ├── Marker.cs │ │ │ └── Point.cs │ │ └── content │ │ │ ├── authPopup.js │ │ │ ├── deliveryMap.js │ │ │ └── leaflet │ │ │ ├── images │ │ │ ├── layers-2x.png │ │ │ ├── layers.png │ │ │ ├── marker-icon-2x.png │ │ │ ├── marker-icon.png │ │ │ └── marker-shadow.png │ │ │ ├── leaflet.css │ │ │ └── leaflet.js │ ├── BlazingPizza.Server │ │ ├── BlazingPizza.Server.csproj │ │ ├── OrdersController.cs │ │ ├── PizzaStoreContext.cs │ │ ├── PizzasController.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── SeedData.cs │ │ ├── SpecialsController.cs │ │ ├── Startup.cs │ │ ├── ToppingsController.cs │ │ ├── UserController.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── BlazingPizza.Shared │ │ ├── BlazingPizza.Shared.csproj │ │ ├── LatLong.cs │ │ ├── Order.cs │ │ ├── OrderWithStatus.cs │ │ ├── Pizza.cs │ │ ├── PizzaSpecial.cs │ │ ├── PizzaTopping.cs │ │ └── Topping.cs │ └── BlazingPizza.sln ├── 06-javascript-interop │ ├── BlazingPizza.Client │ │ ├── App.cshtml │ │ ├── BlazingPizza.Client.csproj │ │ ├── JSRuntimeExtensions.cs │ │ ├── OrderState.cs │ │ ├── Pages │ │ │ ├── Index.cshtml │ │ │ ├── MyOrders.cshtml │ │ │ ├── OrderDetails.cshtml │ │ │ └── _ViewImports.cshtml │ │ ├── Program.cs │ │ ├── Shared │ │ │ ├── ConfigurePizzaDialog.cshtml │ │ │ ├── ConfiguredPizzaItem.cshtml │ │ │ ├── ForceSignInLayout.cshtml │ │ │ ├── MainLayout.cshtml │ │ │ └── UserInfo.cshtml │ │ ├── Startup.cs │ │ ├── _ViewImports.cshtml │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── bootstrap │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ ├── font │ │ │ │ ├── quicksand-v8-latin-300.woff │ │ │ │ ├── quicksand-v8-latin-300.woff2 │ │ │ │ ├── quicksand-v8-latin-500.woff │ │ │ │ ├── quicksand-v8-latin-500.woff2 │ │ │ │ ├── quicksand-v8-latin-700.woff │ │ │ │ ├── quicksand-v8-latin-700.woff2 │ │ │ │ ├── quicksand-v8-latin-regular.woff │ │ │ │ ├── quicksand-v8-latin-regular.woff2 │ │ │ │ └── quicksand.css │ │ │ └── site.css │ │ │ ├── img │ │ │ ├── bike.svg │ │ │ ├── logo.svg │ │ │ ├── pizza-slice.svg │ │ │ ├── pizzas │ │ │ │ ├── bacon.jpg │ │ │ │ ├── brit.jpg │ │ │ │ ├── cheese.jpg │ │ │ │ ├── margherita.jpg │ │ │ │ ├── meaty.jpg │ │ │ │ ├── mushroom.jpg │ │ │ │ ├── pepperoni.jpg │ │ │ │ └── salad.jpg │ │ │ └── user.svg │ │ │ └── index.html │ ├── BlazingPizza.ComponentsLibrary │ │ ├── Authentication │ │ │ ├── UserState.cs │ │ │ └── UserStateProvider.cshtml │ │ ├── BlazingPizza.ComponentsLibrary.csproj │ │ ├── Map │ │ │ ├── Map.cshtml │ │ │ ├── Marker.cs │ │ │ └── Point.cs │ │ └── content │ │ │ ├── authPopup.js │ │ │ ├── deliveryMap.js │ │ │ └── leaflet │ │ │ ├── images │ │ │ ├── layers-2x.png │ │ │ ├── layers.png │ │ │ ├── marker-icon-2x.png │ │ │ ├── marker-icon.png │ │ │ └── marker-shadow.png │ │ │ ├── leaflet.css │ │ │ └── leaflet.js │ ├── BlazingPizza.Server │ │ ├── BlazingPizza.Server.csproj │ │ ├── OrdersController.cs │ │ ├── PizzaStoreContext.cs │ │ ├── PizzasController.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── SeedData.cs │ │ ├── SpecialsController.cs │ │ ├── Startup.cs │ │ ├── ToppingsController.cs │ │ ├── UserController.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── BlazingPizza.Shared │ │ ├── BlazingPizza.Shared.csproj │ │ ├── LatLong.cs │ │ ├── Order.cs │ │ ├── OrderWithStatus.cs │ │ ├── Pizza.cs │ │ ├── PizzaSpecial.cs │ │ ├── PizzaTopping.cs │ │ └── Topping.cs │ └── BlazingPizza.sln └── 07-templated-components │ ├── BlazingComponents │ ├── BlazingComponents.csproj │ ├── TemplatedDialog.cshtml │ └── TemplatedList.cshtml │ ├── BlazingPizza.Client │ ├── App.cshtml │ ├── BlazingPizza.Client.csproj │ ├── OrderState.cs │ ├── Pages │ │ ├── Index.cshtml │ │ ├── MyOrders.cshtml │ │ ├── OrderDetails.cshtml │ │ └── _ViewImports.cshtml │ ├── Program.cs │ ├── Shared │ │ ├── ConfigurePizzaDialog.cshtml │ │ ├── ConfiguredPizzaItem.cshtml │ │ ├── ForceSignInLayout.cshtml │ │ ├── MainLayout.cshtml │ │ └── UserInfo.cshtml │ ├── Startup.cs │ ├── _ViewImports.cshtml │ └── wwwroot │ │ ├── css │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ ├── font │ │ │ ├── quicksand-v8-latin-300.woff │ │ │ ├── quicksand-v8-latin-300.woff2 │ │ │ ├── quicksand-v8-latin-500.woff │ │ │ ├── quicksand-v8-latin-500.woff2 │ │ │ ├── quicksand-v8-latin-700.woff │ │ │ ├── quicksand-v8-latin-700.woff2 │ │ │ ├── quicksand-v8-latin-regular.woff │ │ │ ├── quicksand-v8-latin-regular.woff2 │ │ │ └── quicksand.css │ │ └── site.css │ │ ├── img │ │ ├── bike.svg │ │ ├── logo.svg │ │ ├── pizza-slice.svg │ │ ├── pizzas │ │ │ ├── bacon.jpg │ │ │ ├── brit.jpg │ │ │ ├── cheese.jpg │ │ │ ├── margherita.jpg │ │ │ ├── meaty.jpg │ │ │ ├── mushroom.jpg │ │ │ ├── pepperoni.jpg │ │ │ └── salad.jpg │ │ └── user.svg │ │ └── index.html │ ├── BlazingPizza.ComponentsLibrary │ ├── Authentication │ │ ├── UserState.cs │ │ └── UserStateProvider.cshtml │ ├── BlazingPizza.ComponentsLibrary.csproj │ ├── Map │ │ ├── Map.cshtml │ │ ├── Marker.cs │ │ └── Point.cs │ └── content │ │ ├── authPopup.js │ │ ├── deliveryMap.js │ │ └── leaflet │ │ ├── images │ │ ├── layers-2x.png │ │ ├── layers.png │ │ ├── marker-icon-2x.png │ │ ├── marker-icon.png │ │ └── marker-shadow.png │ │ ├── leaflet.css │ │ └── leaflet.js │ ├── BlazingPizza.Server │ ├── BlazingPizza.Server.csproj │ ├── OrdersController.cs │ ├── PizzaStoreContext.cs │ ├── PizzasController.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── SeedData.cs │ ├── SpecialsController.cs │ ├── Startup.cs │ ├── ToppingsController.cs │ ├── UserController.cs │ ├── appsettings.Development.json │ └── appsettings.json │ ├── BlazingPizza.Shared │ ├── BlazingPizza.Shared.csproj │ ├── LatLong.cs │ ├── Order.cs │ ├── OrderWithStatus.cs │ ├── Pizza.cs │ ├── PizzaSpecial.cs │ ├── PizzaTopping.cs │ └── Topping.cs │ └── BlazingPizza.sln ├── src ├── BlazingComponents │ ├── BlazingComponents.csproj │ ├── TemplatedDialog.razor │ └── TemplatedList.razor ├── BlazingPizza.Client │ ├── App.razor │ ├── BlazingPizza.Client.csproj │ ├── OrderState.cs │ ├── Pages │ │ ├── Index.razor │ │ ├── MyOrders.razor │ │ ├── OrderDetails.razor │ │ └── _Imports.razor │ ├── Program.cs │ ├── Shared │ │ ├── ConfigurePizzaDialog.razor │ │ ├── ConfiguredPizzaItem.razor │ │ ├── ForceSignInLayout.razor │ │ ├── MainLayout.razor │ │ └── UserInfo.razor │ ├── Startup.cs │ ├── _Imports.razor │ └── wwwroot │ │ ├── css │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ ├── font │ │ │ ├── quicksand-v8-latin-300.woff │ │ │ ├── quicksand-v8-latin-300.woff2 │ │ │ ├── quicksand-v8-latin-500.woff │ │ │ ├── quicksand-v8-latin-500.woff2 │ │ │ ├── quicksand-v8-latin-700.woff │ │ │ ├── quicksand-v8-latin-700.woff2 │ │ │ ├── quicksand-v8-latin-regular.woff │ │ │ ├── quicksand-v8-latin-regular.woff2 │ │ │ └── quicksand.css │ │ └── site.css │ │ ├── img │ │ ├── bike.svg │ │ ├── logo.svg │ │ ├── pizza-slice.svg │ │ ├── pizzas │ │ │ ├── bacon.jpg │ │ │ ├── brit.jpg │ │ │ ├── cheese.jpg │ │ │ ├── margherita.jpg │ │ │ ├── meaty.jpg │ │ │ ├── mushroom.jpg │ │ │ ├── pepperoni.jpg │ │ │ └── salad.jpg │ │ └── user.svg │ │ └── index.html ├── BlazingPizza.ComponentsLibrary │ ├── Authentication │ │ ├── UserState.cs │ │ └── UserStateProvider.razor │ ├── BlazingPizza.ComponentsLibrary.csproj │ ├── Map │ │ ├── Map.razor │ │ ├── Marker.cs │ │ └── Point.cs │ └── content │ │ ├── authPopup.js │ │ ├── deliveryMap.js │ │ └── leaflet │ │ ├── images │ │ ├── layers-2x.png │ │ ├── layers.png │ │ ├── marker-icon-2x.png │ │ ├── marker-icon.png │ │ └── marker-shadow.png │ │ ├── leaflet.css │ │ └── leaflet.js ├── BlazingPizza.Server │ ├── BlazingPizza.Server.csproj │ ├── OrdersController.cs │ ├── PizzaStoreContext.cs │ ├── PizzasController.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── SeedData.cs │ ├── SpecialsController.cs │ ├── Startup.cs │ ├── ToppingsController.cs │ ├── UserController.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── BlazingPizza.Shared │ ├── BlazingPizza.Shared.csproj │ ├── LatLong.cs │ ├── Order.cs │ ├── OrderWithStatus.cs │ ├── Pizza.cs │ ├── PizzaSpecial.cs │ ├── PizzaTopping.cs │ └── Topping.cs └── BlazingPizza.sln └── ui-mockup.pptx /save-points/00-Starting-point/BlazingPizza.Client/App.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/BlazingPizza.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | Exe 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Blazing Pizzas

4 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Hosting; 2 | 3 | namespace BlazingPizza.Client 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | CreateHostBuilder(args).Build().Run(); 10 | } 11 | 12 | public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => 13 | BlazorWebAssemblyHost.CreateDefaultBuilder() 14 | .UseBlazorStartup(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/Shared/MainLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | 3 |
4 | @Body 5 |
6 | 7 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Builder; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace BlazingPizza.Client 5 | { 6 | public class Startup 7 | { 8 | public void ConfigureServices(IServiceCollection services) 9 | { 10 | 11 | } 12 | 13 | public void Configure(IBlazorApplicationBuilder app) 14 | { 15 | app.AddComponent("app"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Blazor.Layouts 3 | @using Microsoft.AspNetCore.Blazor.Routing 4 | @using Microsoft.AspNetCore.Blazor.Services 5 | @using Microsoft.JSInterop 6 | @using BlazingPizza.Client 7 | @using BlazingPizza.Client.Shared 8 | @using BlazingPizza.ComponentsLibrary.Authentication 9 | @addTagHelper "*, BlazingPizza.ComponentsLibrary" -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2 -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2 -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2 -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2 -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Blazing Pizza 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/Authentication/UserState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Authentication 2 | { 3 | public class UserState 4 | { 5 | public bool IsLoggedIn { get; set; } 6 | 7 | public string DisplayName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/Map/Map.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.JSInterop 2 | @inject IJSRuntime JSRuntime 3 | 4 |
5 | 6 | @functions { 7 | string elementId = $"map-{Guid.NewGuid().ToString("D")}"; 8 | 9 | [Parameter] double Zoom { get; set; } 10 | [Parameter] List Markers { get; set; } 11 | 12 | protected async override Task OnAfterRenderAsync() 13 | { 14 | await JSRuntime.InvokeAsync( 15 | "deliveryMap.showOrUpdate", 16 | elementId, 17 | Markers); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/Map/Marker.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Marker 4 | { 5 | public string Description { get; set; } 6 | 7 | public double X { get; set; } 8 | 9 | public double Y { get; set; } 10 | 11 | public bool ShowPopup { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/Map/Point.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Point 4 | { 5 | public double X { get; set; } 6 | 7 | public double Y { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/00-Starting-point/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Server/PizzasController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace BlazingPizza.Server 4 | { 5 | [Route("pizzas")] 6 | [ApiController] 7 | public class PizzasController : Controller 8 | { 9 | private readonly PizzaStoreContext _db; 10 | 11 | public PizzasController(PizzaStoreContext db) 12 | { 13 | _db = db; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64589/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazingPizza.Server": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:64590/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Server/SpecialsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("specials")] 10 | [ApiController] 11 | public class SpecialsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public SpecialsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetSpecials() 22 | { 23 | return await _db.Specials.OrderByDescending(s => s.BasePrice).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Server/ToppingsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("toppings")] 10 | [ApiController] 11 | public class ToppingsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public ToppingsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetToppings() 22 | { 23 | return await _db.Toppings.OrderBy(t => t.Name).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "Authentication": { 10 | "Twitter": { 11 | "ConsumerKey": "U9DbAaVcDPYO3RVFlDo4w", 12 | "ConsumerSecret": "l6HWZa8F5MJmbBkGSzL6gMjgZMererT5KROxAzws9o" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Shared/BlazingPizza.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | BlazingPizza 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Shared/LatLong.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazingPizza 4 | { 5 | public class LatLong 6 | { 7 | public LatLong() 8 | { 9 | } 10 | 11 | public LatLong(double latitude, double longitude) : this() 12 | { 13 | Latitude = latitude; 14 | Longitude = longitude; 15 | } 16 | 17 | public double Latitude { get; set; } 18 | 19 | public double Longitude { get; set; } 20 | 21 | public static LatLong Interpolate(LatLong start, LatLong end, double proportion) 22 | { 23 | // The Earth is flat, right? So no need for spherical interpolation. 24 | return new LatLong( 25 | start.Latitude + (end.Latitude - start.Latitude) * proportion, 26 | start.Longitude + (end.Longitude - start.Longitude) * proportion); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Shared/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace BlazingPizza 6 | { 7 | public class Order 8 | { 9 | public int OrderId { get; set; } 10 | 11 | public string UserId { get; set; } 12 | 13 | public DateTime CreatedTime { get; set; } 14 | 15 | public LatLong DeliveryLocation { get; set; } 16 | 17 | public List Pizzas { get; set; } = new List(); 18 | 19 | public decimal GetTotalPrice() => Pizzas.Sum(p => p.GetTotalPrice()); 20 | 21 | public string GetFormattedTotalPrice() => GetTotalPrice().ToString("0.00"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Shared/PizzaSpecial.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | /// 4 | /// Represents a pre-configured template for a pizza a user can order 5 | /// 6 | public class PizzaSpecial 7 | { 8 | public int Id { get; set; } 9 | 10 | public string Name { get; set; } 11 | 12 | public decimal BasePrice { get; set; } 13 | 14 | public string Description { get; set; } 15 | 16 | public string ImageUrl { get; set; } 17 | 18 | public string GetFormattedBasePrice() => BasePrice.ToString("0.00"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Shared/PizzaTopping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class PizzaTopping 4 | { 5 | public Topping Topping { get; set; } 6 | 7 | public int ToppingId { get; set; } 8 | 9 | public int PizzaId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /save-points/00-Starting-point/BlazingPizza.Shared/Topping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class Topping 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Price { get; set; } 10 | 11 | public string GetFormattedPrice() => Price.ToString("0.00"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/App.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/BlazingPizza.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | Exe 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Hosting; 2 | 3 | namespace BlazingPizza.Client 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | CreateHostBuilder(args).Build().Run(); 10 | } 11 | 12 | public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => 13 | BlazorWebAssemblyHost.CreateDefaultBuilder() 14 | .UseBlazorStartup(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/Shared/MainLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | 3 |
4 | 5 | 6 | 7 | 8 |
Get Pizza
9 |
10 |
11 | 12 |
13 | @Body 14 |
15 | 16 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Builder; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace BlazingPizza.Client 5 | { 6 | public class Startup 7 | { 8 | public void ConfigureServices(IServiceCollection services) 9 | { 10 | 11 | } 12 | 13 | public void Configure(IBlazorApplicationBuilder app) 14 | { 15 | app.AddComponent("app"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Blazor.Layouts 3 | @using Microsoft.AspNetCore.Blazor.Routing 4 | @using Microsoft.AspNetCore.Blazor.Services 5 | @using Microsoft.JSInterop 6 | @using BlazingPizza.Client 7 | @using BlazingPizza.Client.Shared 8 | @using BlazingPizza.ComponentsLibrary.Authentication 9 | @addTagHelper "*, BlazingPizza.ComponentsLibrary" 10 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2 -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2 -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2 -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2 -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Blazing Pizza 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/Authentication/UserState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Authentication 2 | { 3 | public class UserState 4 | { 5 | public bool IsLoggedIn { get; set; } 6 | 7 | public string DisplayName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/Map/Map.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.JSInterop 2 | @inject IJSRuntime JSRuntime 3 | 4 |
5 | 6 | @functions { 7 | string elementId = $"map-{Guid.NewGuid().ToString("D")}"; 8 | 9 | [Parameter] double Zoom { get; set; } 10 | [Parameter] List Markers { get; set; } 11 | 12 | protected async override Task OnAfterRenderAsync() 13 | { 14 | await JSRuntime.InvokeAsync( 15 | "deliveryMap.showOrUpdate", 16 | elementId, 17 | Markers); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/Map/Marker.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Marker 4 | { 5 | public string Description { get; set; } 6 | 7 | public double X { get; set; } 8 | 9 | public double Y { get; set; } 10 | 11 | public bool ShowPopup { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/Map/Point.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Point 4 | { 5 | public double X { get; set; } 6 | 7 | public double Y { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/01-Components-and-layout/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Server/PizzasController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace BlazingPizza.Server 4 | { 5 | [Route("pizzas")] 6 | [ApiController] 7 | public class PizzasController : Controller 8 | { 9 | private readonly PizzaStoreContext _db; 10 | 11 | public PizzasController(PizzaStoreContext db) 12 | { 13 | _db = db; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64589/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazingPizza.Server": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:64590/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Server/SpecialsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("specials")] 10 | [ApiController] 11 | public class SpecialsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public SpecialsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetSpecials() 22 | { 23 | return await _db.Specials.OrderByDescending(s => s.BasePrice).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Server/ToppingsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("toppings")] 10 | [ApiController] 11 | public class ToppingsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public ToppingsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetToppings() 22 | { 23 | return await _db.Toppings.OrderBy(t => t.Name).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "Authentication": { 10 | "Twitter": { 11 | "ConsumerKey": "U9DbAaVcDPYO3RVFlDo4w", 12 | "ConsumerSecret": "l6HWZa8F5MJmbBkGSzL6gMjgZMererT5KROxAzws9o" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Shared/BlazingPizza.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | BlazingPizza 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Shared/LatLong.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazingPizza 4 | { 5 | public class LatLong 6 | { 7 | public LatLong() 8 | { 9 | } 10 | 11 | public LatLong(double latitude, double longitude) : this() 12 | { 13 | Latitude = latitude; 14 | Longitude = longitude; 15 | } 16 | 17 | public double Latitude { get; set; } 18 | 19 | public double Longitude { get; set; } 20 | 21 | public static LatLong Interpolate(LatLong start, LatLong end, double proportion) 22 | { 23 | // The Earth is flat, right? So no need for spherical interpolation. 24 | return new LatLong( 25 | start.Latitude + (end.Latitude - start.Latitude) * proportion, 26 | start.Longitude + (end.Longitude - start.Longitude) * proportion); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Shared/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace BlazingPizza 6 | { 7 | public class Order 8 | { 9 | public int OrderId { get; set; } 10 | 11 | public string UserId { get; set; } 12 | 13 | public DateTime CreatedTime { get; set; } 14 | 15 | public LatLong DeliveryLocation { get; set; } 16 | 17 | public List Pizzas { get; set; } = new List(); 18 | 19 | public decimal GetTotalPrice() => Pizzas.Sum(p => p.GetTotalPrice()); 20 | 21 | public string GetFormattedTotalPrice() => GetTotalPrice().ToString("0.00"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Shared/PizzaSpecial.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | /// 4 | /// Represents a pre-configured template for a pizza a user can order 5 | /// 6 | public class PizzaSpecial 7 | { 8 | public int Id { get; set; } 9 | 10 | public string Name { get; set; } 11 | 12 | public decimal BasePrice { get; set; } 13 | 14 | public string Description { get; set; } 15 | 16 | public string ImageUrl { get; set; } 17 | 18 | public string GetFormattedBasePrice() => BasePrice.ToString("0.00"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Shared/PizzaTopping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class PizzaTopping 4 | { 5 | public Topping Topping { get; set; } 6 | 7 | public int ToppingId { get; set; } 8 | 9 | public int PizzaId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /save-points/01-Components-and-layout/BlazingPizza.Shared/Topping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class Topping 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Price { get; set; } 10 | 11 | public string GetFormattedPrice() => Price.ToString("0.00"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/App.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/BlazingPizza.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | Exe 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Hosting; 2 | 3 | namespace BlazingPizza.Client 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | CreateHostBuilder(args).Build().Run(); 10 | } 11 | 12 | public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => 13 | BlazorWebAssemblyHost.CreateDefaultBuilder() 14 | .UseBlazorStartup(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/Shared/ConfiguredPizzaItem.cshtml: -------------------------------------------------------------------------------- 1 | 
2 | x 3 |
@(Pizza.Size)" @Pizza.Special.Name
4 |
    5 | @foreach (var topping in Pizza.Toppings) 6 | { 7 |
  • + @topping.Topping.Name
  • 8 | } 9 |
10 |
11 | @Pizza.GetFormattedTotalPrice() 12 |
13 |
14 | 15 | @functions { 16 | [Parameter] Pizza Pizza { get; set; } 17 | [Parameter] Action OnRemoved { get; set; } 18 | } -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/Shared/MainLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | 3 |
4 | 5 | 6 | 7 | 8 |
Get Pizza
9 |
10 |
11 | 12 |
13 | @Body 14 |
15 | 16 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Builder; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace BlazingPizza.Client 5 | { 6 | public class Startup 7 | { 8 | public void ConfigureServices(IServiceCollection services) 9 | { 10 | 11 | } 12 | 13 | public void Configure(IBlazorApplicationBuilder app) 14 | { 15 | app.AddComponent("app"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Blazor.Layouts 3 | @using Microsoft.AspNetCore.Blazor.Routing 4 | @using Microsoft.AspNetCore.Blazor.Services 5 | @using Microsoft.JSInterop 6 | @using BlazingPizza.Client 7 | @using BlazingPizza.Client.Shared 8 | @using BlazingPizza.ComponentsLibrary.Authentication 9 | @addTagHelper "*, BlazingPizza.ComponentsLibrary" 10 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2 -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2 -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2 -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2 -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Blazing Pizza 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/Authentication/UserState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Authentication 2 | { 3 | public class UserState 4 | { 5 | public bool IsLoggedIn { get; set; } 6 | 7 | public string DisplayName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/Map/Map.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.JSInterop 2 | @inject IJSRuntime JSRuntime 3 | 4 |
5 | 6 | @functions { 7 | string elementId = $"map-{Guid.NewGuid().ToString("D")}"; 8 | 9 | [Parameter] double Zoom { get; set; } 10 | [Parameter] List Markers { get; set; } 11 | 12 | protected async override Task OnAfterRenderAsync() 13 | { 14 | await JSRuntime.InvokeAsync( 15 | "deliveryMap.showOrUpdate", 16 | elementId, 17 | Markers); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/Map/Marker.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Marker 4 | { 5 | public string Description { get; set; } 6 | 7 | public double X { get; set; } 8 | 9 | public double Y { get; set; } 10 | 11 | public bool ShowPopup { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/Map/Point.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Point 4 | { 5 | public double X { get; set; } 6 | 7 | public double Y { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/02-customize-a-pizza/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Server/PizzasController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace BlazingPizza.Server 4 | { 5 | [Route("pizzas")] 6 | [ApiController] 7 | public class PizzasController : Controller 8 | { 9 | private readonly PizzaStoreContext _db; 10 | 11 | public PizzasController(PizzaStoreContext db) 12 | { 13 | _db = db; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64589/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazingPizza.Server": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:64590/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Server/SpecialsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("specials")] 10 | [ApiController] 11 | public class SpecialsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public SpecialsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetSpecials() 22 | { 23 | return await _db.Specials.OrderByDescending(s => s.BasePrice).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Server/ToppingsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("toppings")] 10 | [ApiController] 11 | public class ToppingsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public ToppingsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetToppings() 22 | { 23 | return await _db.Toppings.OrderBy(t => t.Name).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "Authentication": { 10 | "Twitter": { 11 | "ConsumerKey": "U9DbAaVcDPYO3RVFlDo4w", 12 | "ConsumerSecret": "l6HWZa8F5MJmbBkGSzL6gMjgZMererT5KROxAzws9o" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Shared/BlazingPizza.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | BlazingPizza 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Shared/LatLong.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazingPizza 4 | { 5 | public class LatLong 6 | { 7 | public LatLong() 8 | { 9 | } 10 | 11 | public LatLong(double latitude, double longitude) : this() 12 | { 13 | Latitude = latitude; 14 | Longitude = longitude; 15 | } 16 | 17 | public double Latitude { get; set; } 18 | 19 | public double Longitude { get; set; } 20 | 21 | public static LatLong Interpolate(LatLong start, LatLong end, double proportion) 22 | { 23 | // The Earth is flat, right? So no need for spherical interpolation. 24 | return new LatLong( 25 | start.Latitude + (end.Latitude - start.Latitude) * proportion, 26 | start.Longitude + (end.Longitude - start.Longitude) * proportion); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Shared/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace BlazingPizza 6 | { 7 | public class Order 8 | { 9 | public int OrderId { get; set; } 10 | 11 | public string UserId { get; set; } 12 | 13 | public DateTime CreatedTime { get; set; } 14 | 15 | public LatLong DeliveryLocation { get; set; } 16 | 17 | public List Pizzas { get; set; } = new List(); 18 | 19 | public decimal GetTotalPrice() => Pizzas.Sum(p => p.GetTotalPrice()); 20 | 21 | public string GetFormattedTotalPrice() => GetTotalPrice().ToString("0.00"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Shared/PizzaSpecial.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | /// 4 | /// Represents a pre-configured template for a pizza a user can order 5 | /// 6 | public class PizzaSpecial 7 | { 8 | public int Id { get; set; } 9 | 10 | public string Name { get; set; } 11 | 12 | public decimal BasePrice { get; set; } 13 | 14 | public string Description { get; set; } 15 | 16 | public string ImageUrl { get; set; } 17 | 18 | public string GetFormattedBasePrice() => BasePrice.ToString("0.00"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Shared/PizzaTopping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class PizzaTopping 4 | { 5 | public Topping Topping { get; set; } 6 | 7 | public int ToppingId { get; set; } 8 | 9 | public int PizzaId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /save-points/02-customize-a-pizza/BlazingPizza.Shared/Topping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class Topping 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Price { get; set; } 10 | 11 | public string GetFormattedPrice() => Price.ToString("0.00"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/App.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/BlazingPizza.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | Exe 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Hosting; 2 | 3 | namespace BlazingPizza.Client 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | CreateHostBuilder(args).Build().Run(); 10 | } 11 | 12 | public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => 13 | BlazorWebAssemblyHost.CreateDefaultBuilder() 14 | .UseBlazorStartup(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/Shared/ConfiguredPizzaItem.cshtml: -------------------------------------------------------------------------------- 1 | 
2 | x 3 |
@(Pizza.Size)" @Pizza.Special.Name
4 |
    5 | @foreach (var topping in Pizza.Toppings) 6 | { 7 |
  • + @topping.Topping.Name
  • 8 | } 9 |
10 |
11 | @Pizza.GetFormattedTotalPrice() 12 |
13 |
14 | 15 | @functions { 16 | [Parameter] Pizza Pizza { get; set; } 17 | [Parameter] Action OnRemoved { get; set; } 18 | } -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/Shared/MainLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | 3 |
4 | 5 | 6 | 7 | 8 |
Get Pizza
9 |
10 | 11 | 12 | 13 |
My Orders
14 |
15 |
16 | 17 |
18 | @Body 19 |
20 | 21 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Builder; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace BlazingPizza.Client 5 | { 6 | public class Startup 7 | { 8 | public void ConfigureServices(IServiceCollection services) 9 | { 10 | 11 | } 12 | 13 | public void Configure(IBlazorApplicationBuilder app) 14 | { 15 | app.AddComponent("app"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Blazor.Layouts 3 | @using Microsoft.AspNetCore.Blazor.Routing 4 | @using Microsoft.AspNetCore.Blazor.Services 5 | @using Microsoft.JSInterop 6 | @using BlazingPizza.Client 7 | @using BlazingPizza.Client.Shared 8 | @using BlazingPizza.ComponentsLibrary.Authentication 9 | @addTagHelper "*, BlazingPizza.ComponentsLibrary" 10 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2 -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2 -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2 -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2 -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Blazing Pizza 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/Authentication/UserState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Authentication 2 | { 3 | public class UserState 4 | { 5 | public bool IsLoggedIn { get; set; } 6 | 7 | public string DisplayName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/Map/Map.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.JSInterop 2 | @inject IJSRuntime JSRuntime 3 | 4 |
5 | 6 | @functions { 7 | string elementId = $"map-{Guid.NewGuid().ToString("D")}"; 8 | 9 | [Parameter] double Zoom { get; set; } 10 | [Parameter] List Markers { get; set; } 11 | 12 | protected async override Task OnAfterRenderAsync() 13 | { 14 | await JSRuntime.InvokeAsync( 15 | "deliveryMap.showOrUpdate", 16 | elementId, 17 | Markers); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/Map/Marker.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Marker 4 | { 5 | public string Description { get; set; } 6 | 7 | public double X { get; set; } 8 | 9 | public double Y { get; set; } 10 | 11 | public bool ShowPopup { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/Map/Point.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Point 4 | { 5 | public double X { get; set; } 6 | 7 | public double Y { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/03-show-order-status/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Server/PizzasController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace BlazingPizza.Server 4 | { 5 | [Route("pizzas")] 6 | [ApiController] 7 | public class PizzasController : Controller 8 | { 9 | private readonly PizzaStoreContext _db; 10 | 11 | public PizzasController(PizzaStoreContext db) 12 | { 13 | _db = db; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64589/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazingPizza.Server": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:64590/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Server/SpecialsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("specials")] 10 | [ApiController] 11 | public class SpecialsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public SpecialsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetSpecials() 22 | { 23 | return await _db.Specials.OrderByDescending(s => s.BasePrice).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Server/ToppingsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("toppings")] 10 | [ApiController] 11 | public class ToppingsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public ToppingsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetToppings() 22 | { 23 | return await _db.Toppings.OrderBy(t => t.Name).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "Authentication": { 10 | "Twitter": { 11 | "ConsumerKey": "U9DbAaVcDPYO3RVFlDo4w", 12 | "ConsumerSecret": "l6HWZa8F5MJmbBkGSzL6gMjgZMererT5KROxAzws9o" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Shared/BlazingPizza.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | BlazingPizza 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Shared/LatLong.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazingPizza 4 | { 5 | public class LatLong 6 | { 7 | public LatLong() 8 | { 9 | } 10 | 11 | public LatLong(double latitude, double longitude) : this() 12 | { 13 | Latitude = latitude; 14 | Longitude = longitude; 15 | } 16 | 17 | public double Latitude { get; set; } 18 | 19 | public double Longitude { get; set; } 20 | 21 | public static LatLong Interpolate(LatLong start, LatLong end, double proportion) 22 | { 23 | // The Earth is flat, right? So no need for spherical interpolation. 24 | return new LatLong( 25 | start.Latitude + (end.Latitude - start.Latitude) * proportion, 26 | start.Longitude + (end.Longitude - start.Longitude) * proportion); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Shared/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace BlazingPizza 6 | { 7 | public class Order 8 | { 9 | public int OrderId { get; set; } 10 | 11 | public string UserId { get; set; } 12 | 13 | public DateTime CreatedTime { get; set; } 14 | 15 | public LatLong DeliveryLocation { get; set; } 16 | 17 | public List Pizzas { get; set; } = new List(); 18 | 19 | public decimal GetTotalPrice() => Pizzas.Sum(p => p.GetTotalPrice()); 20 | 21 | public string GetFormattedTotalPrice() => GetTotalPrice().ToString("0.00"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Shared/PizzaSpecial.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | /// 4 | /// Represents a pre-configured template for a pizza a user can order 5 | /// 6 | public class PizzaSpecial 7 | { 8 | public int Id { get; set; } 9 | 10 | public string Name { get; set; } 11 | 12 | public decimal BasePrice { get; set; } 13 | 14 | public string Description { get; set; } 15 | 16 | public string ImageUrl { get; set; } 17 | 18 | public string GetFormattedBasePrice() => BasePrice.ToString("0.00"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Shared/PizzaTopping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class PizzaTopping 4 | { 5 | public Topping Topping { get; set; } 6 | 7 | public int ToppingId { get; set; } 8 | 9 | public int PizzaId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /save-points/03-show-order-status/BlazingPizza.Shared/Topping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class Topping 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Price { get; set; } 10 | 11 | public string GetFormattedPrice() => Price.ToString("0.00"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/App.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/BlazingPizza.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | Exe 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Hosting; 2 | 3 | namespace BlazingPizza.Client 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | CreateHostBuilder(args).Build().Run(); 10 | } 11 | 12 | public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => 13 | BlazorWebAssemblyHost.CreateDefaultBuilder() 14 | .UseBlazorStartup(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/Shared/ConfiguredPizzaItem.cshtml: -------------------------------------------------------------------------------- 1 | 
2 | x 3 |
@(Pizza.Size)" @Pizza.Special.Name
4 |
    5 | @foreach (var topping in Pizza.Toppings) 6 | { 7 |
  • + @topping.Topping.Name
  • 8 | } 9 |
10 |
11 | @Pizza.GetFormattedTotalPrice() 12 |
13 |
14 | 15 | @functions { 16 | [Parameter] Pizza Pizza { get; set; } 17 | [Parameter] Action OnRemoved { get; set; } 18 | } -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/Shared/MainLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | 3 |
4 | 5 | 6 | 7 | 8 |
Get Pizza
9 |
10 | 11 | 12 | 13 |
My Orders
14 |
15 |
16 | 17 |
18 | @Body 19 |
20 | 21 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Builder; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace BlazingPizza.Client 5 | { 6 | public class Startup 7 | { 8 | public void ConfigureServices(IServiceCollection services) 9 | { 10 | services.AddScoped(); 11 | } 12 | 13 | public void Configure(IBlazorApplicationBuilder app) 14 | { 15 | app.AddComponent("app"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Blazor.Layouts 3 | @using Microsoft.AspNetCore.Blazor.Routing 4 | @using Microsoft.AspNetCore.Blazor.Services 5 | @using Microsoft.JSInterop 6 | @using BlazingPizza.Client 7 | @using BlazingPizza.Client.Shared 8 | @using BlazingPizza.ComponentsLibrary.Authentication 9 | @addTagHelper "*, BlazingPizza.ComponentsLibrary" 10 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2 -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2 -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2 -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2 -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Blazing Pizza 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/Authentication/UserState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Authentication 2 | { 3 | public class UserState 4 | { 5 | public bool IsLoggedIn { get; set; } 6 | 7 | public string DisplayName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/Map/Map.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.JSInterop 2 | @inject IJSRuntime JSRuntime 3 | 4 |
5 | 6 | @functions { 7 | string elementId = $"map-{Guid.NewGuid().ToString("D")}"; 8 | 9 | [Parameter] double Zoom { get; set; } 10 | [Parameter] List Markers { get; set; } 11 | 12 | protected async override Task OnAfterRenderAsync() 13 | { 14 | await JSRuntime.InvokeAsync( 15 | "deliveryMap.showOrUpdate", 16 | elementId, 17 | Markers); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/Map/Marker.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Marker 4 | { 5 | public string Description { get; set; } 6 | 7 | public double X { get; set; } 8 | 9 | public double Y { get; set; } 10 | 11 | public bool ShowPopup { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/Map/Point.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Point 4 | { 5 | public double X { get; set; } 6 | 7 | public double Y { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/04-refactor-state-management/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Server/PizzasController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace BlazingPizza.Server 4 | { 5 | [Route("pizzas")] 6 | [ApiController] 7 | public class PizzasController : Controller 8 | { 9 | private readonly PizzaStoreContext _db; 10 | 11 | public PizzasController(PizzaStoreContext db) 12 | { 13 | _db = db; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64589/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazingPizza.Server": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:64590/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Server/SpecialsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("specials")] 10 | [ApiController] 11 | public class SpecialsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public SpecialsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetSpecials() 22 | { 23 | return await _db.Specials.OrderByDescending(s => s.BasePrice).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Server/ToppingsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("toppings")] 10 | [ApiController] 11 | public class ToppingsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public ToppingsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetToppings() 22 | { 23 | return await _db.Toppings.OrderBy(t => t.Name).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "Authentication": { 10 | "Twitter": { 11 | "ConsumerKey": "U9DbAaVcDPYO3RVFlDo4w", 12 | "ConsumerSecret": "l6HWZa8F5MJmbBkGSzL6gMjgZMererT5KROxAzws9o" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Shared/BlazingPizza.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | BlazingPizza 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Shared/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace BlazingPizza 6 | { 7 | public class Order 8 | { 9 | public int OrderId { get; set; } 10 | 11 | public string UserId { get; set; } 12 | 13 | public DateTime CreatedTime { get; set; } 14 | 15 | public LatLong DeliveryLocation { get; set; } 16 | 17 | public List Pizzas { get; set; } = new List(); 18 | 19 | public decimal GetTotalPrice() => Pizzas.Sum(p => p.GetTotalPrice()); 20 | 21 | public string GetFormattedTotalPrice() => GetTotalPrice().ToString("0.00"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Shared/PizzaSpecial.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | /// 4 | /// Represents a pre-configured template for a pizza a user can order 5 | /// 6 | public class PizzaSpecial 7 | { 8 | public int Id { get; set; } 9 | 10 | public string Name { get; set; } 11 | 12 | public decimal BasePrice { get; set; } 13 | 14 | public string Description { get; set; } 15 | 16 | public string ImageUrl { get; set; } 17 | 18 | public string GetFormattedBasePrice() => BasePrice.ToString("0.00"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Shared/PizzaTopping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class PizzaTopping 4 | { 5 | public Topping Topping { get; set; } 6 | 7 | public int ToppingId { get; set; } 8 | 9 | public int PizzaId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /save-points/04-refactor-state-management/BlazingPizza.Shared/Topping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class Topping 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Price { get; set; } 10 | 11 | public string GetFormattedPrice() => Price.ToString("0.00"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/App.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/BlazingPizza.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | Exe 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Hosting; 2 | 3 | namespace BlazingPizza.Client 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | CreateHostBuilder(args).Build().Run(); 10 | } 11 | 12 | public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => 13 | BlazorWebAssemblyHost.CreateDefaultBuilder() 14 | .UseBlazorStartup(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/Shared/ConfiguredPizzaItem.cshtml: -------------------------------------------------------------------------------- 1 | 
2 | x 3 |
@(Pizza.Size)" @Pizza.Special.Name
4 |
    5 | @foreach (var topping in Pizza.Toppings) 6 | { 7 |
  • + @topping.Topping.Name
  • 8 | } 9 |
10 |
11 | @Pizza.GetFormattedTotalPrice() 12 |
13 |
14 | 15 | @functions { 16 | [Parameter] Pizza Pizza { get; set; } 17 | [Parameter] Action OnRemoved { get; set; } 18 | } -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/Shared/ForceSignInLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | @layout MainLayout 3 | 4 | @if (UserState.CurrentUser == null) // Retrieving the login state 5 | { 6 | Loading... 7 | } 8 | else if (UserState.IsLoggedIn) 9 | { 10 | @Body 11 | } 12 | else 13 | { 14 |
15 |

You're signed out

16 |

To continue, please sign in.

17 | 18 |
19 | } 20 | 21 | @functions { 22 | [CascadingParameter] UserStateProvider UserState { get; set; } 23 | } 24 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/Shared/MainLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | 3 |
4 | 5 | 6 | 7 | 8 |
Get Pizza
9 |
10 | 11 | 12 | 13 |
My Orders
14 |
15 | 16 | 17 |
18 | 19 |
20 | @Body 21 |
22 | 23 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/Shared/UserInfo.cshtml: -------------------------------------------------------------------------------- 1 |  19 | 20 | @functions { 21 | [CascadingParameter] UserStateProvider UserState { get; set; } 22 | } 23 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Builder; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace BlazingPizza.Client 5 | { 6 | public class Startup 7 | { 8 | public void ConfigureServices(IServiceCollection services) 9 | { 10 | services.AddScoped(); 11 | } 12 | 13 | public void Configure(IBlazorApplicationBuilder app) 14 | { 15 | app.AddComponent("app"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Blazor.Layouts 3 | @using Microsoft.AspNetCore.Blazor.Routing 4 | @using Microsoft.AspNetCore.Blazor.Services 5 | @using Microsoft.JSInterop 6 | @using BlazingPizza.Client 7 | @using BlazingPizza.Client.Shared 8 | @using BlazingPizza.ComponentsLibrary.Authentication 9 | @addTagHelper "*, BlazingPizza.ComponentsLibrary" 10 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2 -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2 -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2 -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2 -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Blazing Pizza 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/Authentication/UserState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Authentication 2 | { 3 | public class UserState 4 | { 5 | public bool IsLoggedIn { get; set; } 6 | 7 | public string DisplayName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/Map/Map.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.JSInterop 2 | @inject IJSRuntime JSRuntime 3 | 4 |
5 | 6 | @functions { 7 | string elementId = $"map-{Guid.NewGuid().ToString("D")}"; 8 | 9 | [Parameter] double Zoom { get; set; } 10 | [Parameter] List Markers { get; set; } 11 | 12 | protected async override Task OnAfterRenderAsync() 13 | { 14 | await JSRuntime.InvokeAsync( 15 | "deliveryMap.showOrUpdate", 16 | elementId, 17 | Markers); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/Map/Marker.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Marker 4 | { 5 | public string Description { get; set; } 6 | 7 | public double X { get; set; } 8 | 9 | public double Y { get; set; } 10 | 11 | public bool ShowPopup { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/Map/Point.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Point 4 | { 5 | public double X { get; set; } 6 | 7 | public double Y { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/05-add-authentication/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Server/PizzasController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace BlazingPizza.Server 4 | { 5 | [Route("pizzas")] 6 | [ApiController] 7 | public class PizzasController : Controller 8 | { 9 | private readonly PizzaStoreContext _db; 10 | 11 | public PizzasController(PizzaStoreContext db) 12 | { 13 | _db = db; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64589/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazingPizza.Server": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:64590/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Server/SpecialsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("specials")] 10 | [ApiController] 11 | public class SpecialsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public SpecialsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetSpecials() 22 | { 23 | return await _db.Specials.OrderByDescending(s => s.BasePrice).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Server/ToppingsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("toppings")] 10 | [ApiController] 11 | public class ToppingsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public ToppingsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetToppings() 22 | { 23 | return await _db.Toppings.OrderBy(t => t.Name).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "Authentication": { 10 | "Twitter": { 11 | "ConsumerKey": "U9DbAaVcDPYO3RVFlDo4w", 12 | "ConsumerSecret": "l6HWZa8F5MJmbBkGSzL6gMjgZMererT5KROxAzws9o" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Shared/BlazingPizza.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | BlazingPizza 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Shared/LatLong.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazingPizza 4 | { 5 | public class LatLong 6 | { 7 | public LatLong() 8 | { 9 | } 10 | 11 | public LatLong(double latitude, double longitude) : this() 12 | { 13 | Latitude = latitude; 14 | Longitude = longitude; 15 | } 16 | 17 | public double Latitude { get; set; } 18 | 19 | public double Longitude { get; set; } 20 | 21 | public static LatLong Interpolate(LatLong start, LatLong end, double proportion) 22 | { 23 | // The Earth is flat, right? So no need for spherical interpolation. 24 | return new LatLong( 25 | start.Latitude + (end.Latitude - start.Latitude) * proportion, 26 | start.Longitude + (end.Longitude - start.Longitude) * proportion); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Shared/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace BlazingPizza 6 | { 7 | public class Order 8 | { 9 | public int OrderId { get; set; } 10 | 11 | public string UserId { get; set; } 12 | 13 | public DateTime CreatedTime { get; set; } 14 | 15 | public LatLong DeliveryLocation { get; set; } 16 | 17 | public List Pizzas { get; set; } = new List(); 18 | 19 | public decimal GetTotalPrice() => Pizzas.Sum(p => p.GetTotalPrice()); 20 | 21 | public string GetFormattedTotalPrice() => GetTotalPrice().ToString("0.00"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Shared/PizzaSpecial.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | /// 4 | /// Represents a pre-configured template for a pizza a user can order 5 | /// 6 | public class PizzaSpecial 7 | { 8 | public int Id { get; set; } 9 | 10 | public string Name { get; set; } 11 | 12 | public decimal BasePrice { get; set; } 13 | 14 | public string Description { get; set; } 15 | 16 | public string ImageUrl { get; set; } 17 | 18 | public string GetFormattedBasePrice() => BasePrice.ToString("0.00"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Shared/PizzaTopping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class PizzaTopping 4 | { 5 | public Topping Topping { get; set; } 6 | 7 | public int ToppingId { get; set; } 8 | 9 | public int PizzaId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /save-points/05-add-authentication/BlazingPizza.Shared/Topping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class Topping 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Price { get; set; } 10 | 11 | public string GetFormattedPrice() => Price.ToString("0.00"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/App.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/BlazingPizza.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | Exe 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/JSRuntimeExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.JSInterop; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace BlazingPizza.Client 8 | { 9 | public static class JSRuntimeExtensions 10 | { 11 | public static Task Confirm(this IJSRuntime jsRuntime, string message) 12 | { 13 | return jsRuntime.InvokeAsync("confirm", message); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Hosting; 2 | 3 | namespace BlazingPizza.Client 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | CreateHostBuilder(args).Build().Run(); 10 | } 11 | 12 | public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => 13 | BlazorWebAssemblyHost.CreateDefaultBuilder() 14 | .UseBlazorStartup(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/Shared/ConfiguredPizzaItem.cshtml: -------------------------------------------------------------------------------- 1 | 
2 | x 3 |
@(Pizza.Size)" @Pizza.Special.Name
4 |
    5 | @foreach (var topping in Pizza.Toppings) 6 | { 7 |
  • + @topping.Topping.Name
  • 8 | } 9 |
10 |
11 | @Pizza.GetFormattedTotalPrice() 12 |
13 |
14 | 15 | @functions { 16 | [Parameter] Pizza Pizza { get; set; } 17 | [Parameter] Func OnRemoved { get; set; } 18 | } -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/Shared/ForceSignInLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | @layout MainLayout 3 | 4 | @if (UserState.CurrentUser == null) // Retrieving the login state 5 | { 6 | Loading... 7 | } 8 | else if (UserState.IsLoggedIn) 9 | { 10 | @Body 11 | } 12 | else 13 | { 14 |
15 |

You're signed out

16 |

To continue, please sign in.

17 | 18 |
19 | } 20 | 21 | @functions { 22 | [CascadingParameter] UserStateProvider UserState { get; set; } 23 | } 24 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/Shared/MainLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | 3 |
4 | 5 | 6 | 7 | 8 |
Get Pizza
9 |
10 | 11 | 12 | 13 |
My Orders
14 |
15 | 16 | 17 |
18 | 19 |
20 | @Body 21 |
22 | 23 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/Shared/UserInfo.cshtml: -------------------------------------------------------------------------------- 1 |  19 | 20 | @functions { 21 | [CascadingParameter] UserStateProvider UserState { get; set; } 22 | } 23 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Builder; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace BlazingPizza.Client 5 | { 6 | public class Startup 7 | { 8 | public void ConfigureServices(IServiceCollection services) 9 | { 10 | services.AddScoped(); 11 | } 12 | 13 | public void Configure(IBlazorApplicationBuilder app) 14 | { 15 | app.AddComponent("app"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Blazor.Layouts 3 | @using Microsoft.AspNetCore.Blazor.Routing 4 | @using Microsoft.AspNetCore.Blazor.Services 5 | @using Microsoft.JSInterop 6 | @using BlazingPizza.Client 7 | @using BlazingPizza.Client.Shared 8 | @using BlazingPizza.ComponentsLibrary.Authentication 9 | @addTagHelper "*, BlazingPizza.ComponentsLibrary" 10 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2 -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2 -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2 -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2 -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Blazing Pizza 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/Authentication/UserState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Authentication 2 | { 3 | public class UserState 4 | { 5 | public bool IsLoggedIn { get; set; } 6 | 7 | public string DisplayName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/Map/Map.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.JSInterop 2 | @inject IJSRuntime JSRuntime 3 | 4 |
5 | 6 | @functions { 7 | string elementId = $"map-{Guid.NewGuid().ToString("D")}"; 8 | 9 | [Parameter] double Zoom { get; set; } 10 | [Parameter] List Markers { get; set; } 11 | 12 | protected async override Task OnAfterRenderAsync() 13 | { 14 | await JSRuntime.InvokeAsync( 15 | "deliveryMap.showOrUpdate", 16 | elementId, 17 | Markers); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/Map/Marker.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Marker 4 | { 5 | public string Description { get; set; } 6 | 7 | public double X { get; set; } 8 | 9 | public double Y { get; set; } 10 | 11 | public bool ShowPopup { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/Map/Point.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Point 4 | { 5 | public double X { get; set; } 6 | 7 | public double Y { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/06-javascript-interop/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Server/PizzasController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace BlazingPizza.Server 4 | { 5 | [Route("pizzas")] 6 | [ApiController] 7 | public class PizzasController : Controller 8 | { 9 | private readonly PizzaStoreContext _db; 10 | 11 | public PizzasController(PizzaStoreContext db) 12 | { 13 | _db = db; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64589/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazingPizza.Server": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:64590/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Server/SpecialsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("specials")] 10 | [ApiController] 11 | public class SpecialsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public SpecialsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetSpecials() 22 | { 23 | return await _db.Specials.OrderByDescending(s => s.BasePrice).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Server/ToppingsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("toppings")] 10 | [ApiController] 11 | public class ToppingsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public ToppingsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetToppings() 22 | { 23 | return await _db.Toppings.OrderBy(t => t.Name).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "Authentication": { 10 | "Twitter": { 11 | "ConsumerKey": "U9DbAaVcDPYO3RVFlDo4w", 12 | "ConsumerSecret": "l6HWZa8F5MJmbBkGSzL6gMjgZMererT5KROxAzws9o" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Shared/BlazingPizza.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | BlazingPizza 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Shared/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace BlazingPizza 6 | { 7 | public class Order 8 | { 9 | public int OrderId { get; set; } 10 | 11 | public string UserId { get; set; } 12 | 13 | public DateTime CreatedTime { get; set; } 14 | 15 | public LatLong DeliveryLocation { get; set; } 16 | 17 | public List Pizzas { get; set; } = new List(); 18 | 19 | public decimal GetTotalPrice() => Pizzas.Sum(p => p.GetTotalPrice()); 20 | 21 | public string GetFormattedTotalPrice() => GetTotalPrice().ToString("0.00"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Shared/PizzaSpecial.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | /// 4 | /// Represents a pre-configured template for a pizza a user can order 5 | /// 6 | public class PizzaSpecial 7 | { 8 | public int Id { get; set; } 9 | 10 | public string Name { get; set; } 11 | 12 | public decimal BasePrice { get; set; } 13 | 14 | public string Description { get; set; } 15 | 16 | public string ImageUrl { get; set; } 17 | 18 | public string GetFormattedBasePrice() => BasePrice.ToString("0.00"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Shared/PizzaTopping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class PizzaTopping 4 | { 5 | public Topping Topping { get; set; } 6 | 7 | public int ToppingId { get; set; } 8 | 9 | public int PizzaId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /save-points/06-javascript-interop/BlazingPizza.Shared/Topping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class Topping 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Price { get; set; } 10 | 11 | public string GetFormattedPrice() => Price.ToString("0.00"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingComponents/TemplatedDialog.cshtml: -------------------------------------------------------------------------------- 1 | @if (Show) 2 | { 3 |
4 |
5 | @ChildContent 6 |
7 |
8 | } 9 | 10 | @functions { 11 | [Parameter] RenderFragment ChildContent { get; set; } 12 | [Parameter] bool Show { get; set; } 13 | } -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/App.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/BlazingPizza.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | Exe 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Hosting; 2 | 3 | namespace BlazingPizza.Client 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | CreateHostBuilder(args).Build().Run(); 10 | } 11 | 12 | public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => 13 | BlazorWebAssemblyHost.CreateDefaultBuilder() 14 | .UseBlazorStartup(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/Shared/ConfiguredPizzaItem.cshtml: -------------------------------------------------------------------------------- 1 | 
2 | x 3 |
@(Pizza.Size)" @Pizza.Special.Name
4 |
    5 | @foreach (var topping in Pizza.Toppings) 6 | { 7 |
  • + @topping.Topping.Name
  • 8 | } 9 |
10 |
11 | @Pizza.GetFormattedTotalPrice() 12 |
13 |
14 | 15 | @functions { 16 | [Parameter] Pizza Pizza { get; set; } 17 | [Parameter] Action OnRemoved { get; set; } 18 | } -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/Shared/ForceSignInLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | @layout MainLayout 3 | 4 | @if (UserState.CurrentUser == null) // Retrieving the login state 5 | { 6 | Loading... 7 | } 8 | else if (UserState.IsLoggedIn) 9 | { 10 | @Body 11 | } 12 | else 13 | { 14 |
15 |

You're signed out

16 |

To continue, please sign in.

17 | 18 |
19 | } 20 | 21 | @functions { 22 | [CascadingParameter] UserStateProvider UserState { get; set; } 23 | } 24 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/Shared/MainLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | 3 |
4 | 5 | 6 | 7 | 8 |
Get Pizza
9 |
10 | 11 | 12 | 13 |
My Orders
14 |
15 | 16 | 17 |
18 | 19 |
20 | @Body 21 |
22 | 23 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/Shared/UserInfo.cshtml: -------------------------------------------------------------------------------- 1 |  19 | 20 | @functions { 21 | [CascadingParameter] UserStateProvider UserState { get; set; } 22 | } 23 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Builder; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace BlazingPizza.Client 5 | { 6 | public class Startup 7 | { 8 | public void ConfigureServices(IServiceCollection services) 9 | { 10 | services.AddScoped(); 11 | } 12 | 13 | public void Configure(IBlazorApplicationBuilder app) 14 | { 15 | app.AddComponent("app"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Blazor.Layouts 3 | @using Microsoft.AspNetCore.Blazor.Routing 4 | @using Microsoft.AspNetCore.Blazor.Services 5 | @using Microsoft.JSInterop 6 | @using BlazingPizza.Client 7 | @using BlazingPizza.Client.Shared 8 | @using BlazingPizza.ComponentsLibrary.Authentication 9 | @addTagHelper "*, BlazingPizza.ComponentsLibrary" 10 | @addTagHelper "*, BlazingComponents" 11 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2 -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2 -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2 -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2 -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Blazing Pizza 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.ComponentsLibrary/Authentication/UserState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Authentication 2 | { 3 | public class UserState 4 | { 5 | public bool IsLoggedIn { get; set; } 6 | 7 | public string DisplayName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.ComponentsLibrary/Map/Map.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.JSInterop 2 | @inject IJSRuntime JSRuntime 3 | 4 |
5 | 6 | @functions { 7 | string elementId = $"map-{Guid.NewGuid().ToString("D")}"; 8 | 9 | [Parameter] double Zoom { get; set; } 10 | [Parameter] List Markers { get; set; } 11 | 12 | protected async override Task OnAfterRenderAsync() 13 | { 14 | await JSRuntime.InvokeAsync( 15 | "deliveryMap.showOrUpdate", 16 | elementId, 17 | Markers); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.ComponentsLibrary/Map/Marker.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Marker 4 | { 5 | public string Description { get; set; } 6 | 7 | public double X { get; set; } 8 | 9 | public double Y { get; set; } 10 | 11 | public bool ShowPopup { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.ComponentsLibrary/Map/Point.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Point 4 | { 5 | public double X { get; set; } 6 | 7 | public double Y { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/save-points/07-templated-components/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Server/PizzasController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace BlazingPizza.Server 4 | { 5 | [Route("pizzas")] 6 | [ApiController] 7 | public class PizzasController : Controller 8 | { 9 | private readonly PizzaStoreContext _db; 10 | 11 | public PizzasController(PizzaStoreContext db) 12 | { 13 | _db = db; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64589/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazingPizza.Server": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:64590/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Server/SpecialsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("specials")] 10 | [ApiController] 11 | public class SpecialsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public SpecialsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetSpecials() 22 | { 23 | return await _db.Specials.OrderByDescending(s => s.BasePrice).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Server/ToppingsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("toppings")] 10 | [ApiController] 11 | public class ToppingsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public ToppingsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetToppings() 22 | { 23 | return await _db.Toppings.OrderBy(t => t.Name).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "Authentication": { 10 | "Twitter": { 11 | "ConsumerKey": "U9DbAaVcDPYO3RVFlDo4w", 12 | "ConsumerSecret": "l6HWZa8F5MJmbBkGSzL6gMjgZMererT5KROxAzws9o" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Shared/BlazingPizza.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | BlazingPizza 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Shared/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace BlazingPizza 6 | { 7 | public class Order 8 | { 9 | public int OrderId { get; set; } 10 | 11 | public string UserId { get; set; } 12 | 13 | public DateTime CreatedTime { get; set; } 14 | 15 | public LatLong DeliveryLocation { get; set; } 16 | 17 | public List Pizzas { get; set; } = new List(); 18 | 19 | public decimal GetTotalPrice() => Pizzas.Sum(p => p.GetTotalPrice()); 20 | 21 | public string GetFormattedTotalPrice() => GetTotalPrice().ToString("0.00"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Shared/PizzaSpecial.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | /// 4 | /// Represents a pre-configured template for a pizza a user can order 5 | /// 6 | public class PizzaSpecial 7 | { 8 | public int Id { get; set; } 9 | 10 | public string Name { get; set; } 11 | 12 | public decimal BasePrice { get; set; } 13 | 14 | public string Description { get; set; } 15 | 16 | public string ImageUrl { get; set; } 17 | 18 | public string GetFormattedBasePrice() => BasePrice.ToString("0.00"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Shared/PizzaTopping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class PizzaTopping 4 | { 5 | public Topping Topping { get; set; } 6 | 7 | public int ToppingId { get; set; } 8 | 9 | public int PizzaId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /save-points/07-templated-components/BlazingPizza.Shared/Topping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class Topping 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Price { get; set; } 10 | 11 | public string GetFormattedPrice() => Price.ToString("0.00"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/BlazingComponents/TemplatedDialog.razor: -------------------------------------------------------------------------------- 1 | @if (Show) 2 | { 3 |
4 |
5 | @ChildContent 6 |
7 |
8 | } 9 | 10 | @functions { 11 | [Parameter] RenderFragment ChildContent { get; set; } 12 | [Parameter] bool Show { get; set; } 13 | } -------------------------------------------------------------------------------- /src/BlazingPizza.Client/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/BlazingPizza.Client/Pages/_Imports.razor: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /src/BlazingPizza.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Hosting; 2 | 3 | namespace BlazingPizza.Client 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | CreateHostBuilder(args).Build().Run(); 10 | } 11 | 12 | public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => 13 | BlazorWebAssemblyHost.CreateDefaultBuilder() 14 | .UseBlazorStartup(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/BlazingPizza.Client/Shared/ConfiguredPizzaItem.razor: -------------------------------------------------------------------------------- 1 | 
2 | x 3 |
@(Pizza.Size)" @Pizza.Special.Name
4 |
    5 | @foreach (var topping in Pizza.Toppings) 6 | { 7 |
  • + @topping.Topping.Name
  • 8 | } 9 |
10 |
11 | @Pizza.GetFormattedTotalPrice() 12 |
13 |
14 | 15 | @functions { 16 | [Parameter] Pizza Pizza { get; set; } 17 | [Parameter] Action OnRemoved { get; set; } 18 | } -------------------------------------------------------------------------------- /src/BlazingPizza.Client/Shared/ForceSignInLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @layout MainLayout 3 | 4 | @if (UserState.CurrentUser == null) // Retrieving the login state 5 | { 6 | Loading... 7 | } 8 | else if (UserState.IsLoggedIn) 9 | { 10 | @Body 11 | } 12 | else 13 | { 14 |
15 |

You're signed out

16 |

To continue, please sign in.

17 | 18 |
19 | } 20 | 21 | @functions { 22 | [CascadingParameter] UserStateProvider UserState { get; set; } 23 | } 24 | -------------------------------------------------------------------------------- /src/BlazingPizza.Client/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | 5 | 6 | 7 | 8 |
Get Pizza
9 |
10 | 11 | 12 | 13 |
My Orders
14 |
15 | 16 | 17 |
18 | 19 |
20 | @Body 21 |
22 | 23 | -------------------------------------------------------------------------------- /src/BlazingPizza.Client/Shared/UserInfo.razor: -------------------------------------------------------------------------------- 1 |  19 | 20 | @functions { 21 | [CascadingParameter] UserStateProvider UserState { get; set; } 22 | } 23 | -------------------------------------------------------------------------------- /src/BlazingPizza.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | using Microsoft.AspNetCore.Components.Builder; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using System; 5 | using System.Net.Http; 6 | 7 | namespace BlazingPizza.Client 8 | { 9 | public class Startup 10 | { 11 | public void ConfigureServices(IServiceCollection services) 12 | { 13 | services.AddScoped(); 14 | } 15 | 16 | public void Configure(IComponentsApplicationBuilder app) 17 | { 18 | app.AddComponent("app"); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/BlazingPizza.Client/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Components.Forms 3 | @using Microsoft.AspNetCore.Components.Layouts 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.JSInterop 6 | @using BlazingPizza.Client 7 | @using BlazingPizza.Client.Shared 8 | @using BlazingPizza.ComponentsLibrary 9 | @using BlazingPizza.ComponentsLibrary.Authentication 10 | @using BlazingPizza.ComponentsLibrary.Map 11 | @using BlazingComponents 12 | -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-300.woff2 -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-500.woff2 -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-700.woff2 -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/css/font/quicksand-v8-latin-regular.woff2 -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/img/pizzas/bacon.jpg -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/img/pizzas/brit.jpg -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/img/pizzas/cheese.jpg -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/img/pizzas/margherita.jpg -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/img/pizzas/meaty.jpg -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/img/pizzas/mushroom.jpg -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/img/pizzas/pepperoni.jpg -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.Client/wwwroot/img/pizzas/salad.jpg -------------------------------------------------------------------------------- /src/BlazingPizza.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Blazing Pizza 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/BlazingPizza.ComponentsLibrary/Authentication/UserState.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Authentication 2 | { 3 | public class UserState 4 | { 5 | public bool IsLoggedIn { get; set; } 6 | 7 | public string DisplayName { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/BlazingPizza.ComponentsLibrary/Map/Map.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.JSInterop 2 | @inject IJSRuntime JSRuntime 3 | 4 |
5 | 6 | @functions { 7 | string elementId = $"map-{Guid.NewGuid().ToString("D")}"; 8 | 9 | [Parameter] double Zoom { get; set; } 10 | [Parameter] List Markers { get; set; } 11 | 12 | protected async override Task OnAfterRenderAsync() 13 | { 14 | await JSRuntime.InvokeAsync( 15 | "deliveryMap.showOrUpdate", 16 | elementId, 17 | Markers); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/BlazingPizza.ComponentsLibrary/Map/Marker.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Marker 4 | { 5 | public string Description { get; set; } 6 | 7 | public double X { get; set; } 8 | 9 | public double Y { get; set; } 10 | 11 | public bool ShowPopup { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/BlazingPizza.ComponentsLibrary/Map/Point.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza.ComponentsLibrary.Map 2 | { 3 | public class Point 4 | { 5 | public double X { get; set; } 6 | 7 | public double Y { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers-2x.png -------------------------------------------------------------------------------- /src/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.ComponentsLibrary/content/leaflet/images/layers.png -------------------------------------------------------------------------------- /src/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon-2x.png -------------------------------------------------------------------------------- /src/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-icon.png -------------------------------------------------------------------------------- /src/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/src/BlazingPizza.ComponentsLibrary/content/leaflet/images/marker-shadow.png -------------------------------------------------------------------------------- /src/BlazingPizza.Server/PizzasController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace BlazingPizza.Server 4 | { 5 | [Route("pizzas")] 6 | [ApiController] 7 | public class PizzasController : Controller 8 | { 9 | private readonly PizzaStoreContext _db; 10 | 11 | public PizzasController(PizzaStoreContext db) 12 | { 13 | _db = db; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/BlazingPizza.Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64589/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "BlazingPizza.Server": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:64590/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/BlazingPizza.Server/SpecialsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("specials")] 10 | [ApiController] 11 | public class SpecialsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public SpecialsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetSpecials() 22 | { 23 | return await _db.Specials.OrderByDescending(s => s.BasePrice).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/BlazingPizza.Server/ToppingsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Mvc; 5 | using Microsoft.EntityFrameworkCore; 6 | 7 | namespace BlazingPizza.Server 8 | { 9 | [Route("toppings")] 10 | [ApiController] 11 | public class ToppingsController : Controller 12 | { 13 | private readonly PizzaStoreContext _db; 14 | 15 | public ToppingsController(PizzaStoreContext db) 16 | { 17 | _db = db; 18 | } 19 | 20 | [HttpGet] 21 | public async Task>> GetToppings() 22 | { 23 | return await _db.Toppings.OrderBy(t => t.Name).ToListAsync(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/BlazingPizza.Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | }, 9 | "Authentication": { 10 | "Twitter": { 11 | "ConsumerKey": "U9DbAaVcDPYO3RVFlDo4w", 12 | "ConsumerSecret": "l6HWZa8F5MJmbBkGSzL6gMjgZMererT5KROxAzws9o" 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/BlazingPizza.Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/BlazingPizza.Shared/BlazingPizza.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | BlazingPizza 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/BlazingPizza.Shared/LatLong.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlazingPizza 4 | { 5 | public class LatLong 6 | { 7 | public LatLong() 8 | { 9 | } 10 | 11 | public LatLong(double latitude, double longitude) : this() 12 | { 13 | Latitude = latitude; 14 | Longitude = longitude; 15 | } 16 | 17 | public double Latitude { get; set; } 18 | 19 | public double Longitude { get; set; } 20 | 21 | public static LatLong Interpolate(LatLong start, LatLong end, double proportion) 22 | { 23 | // The Earth is flat, right? So no need for spherical interpolation. 24 | return new LatLong( 25 | start.Latitude + (end.Latitude - start.Latitude) * proportion, 26 | start.Longitude + (end.Longitude - start.Longitude) * proportion); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/BlazingPizza.Shared/Order.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace BlazingPizza 6 | { 7 | public class Order 8 | { 9 | public int OrderId { get; set; } 10 | 11 | public string UserId { get; set; } 12 | 13 | public DateTime CreatedTime { get; set; } 14 | 15 | public LatLong DeliveryLocation { get; set; } 16 | 17 | public List Pizzas { get; set; } = new List(); 18 | 19 | public decimal GetTotalPrice() => Pizzas.Sum(p => p.GetTotalPrice()); 20 | 21 | public string GetFormattedTotalPrice() => GetTotalPrice().ToString("0.00"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/BlazingPizza.Shared/PizzaSpecial.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | /// 4 | /// Represents a pre-configured template for a pizza a user can order 5 | /// 6 | public class PizzaSpecial 7 | { 8 | public int Id { get; set; } 9 | 10 | public string Name { get; set; } 11 | 12 | public decimal BasePrice { get; set; } 13 | 14 | public string Description { get; set; } 15 | 16 | public string ImageUrl { get; set; } 17 | 18 | public string GetFormattedBasePrice() => BasePrice.ToString("0.00"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/BlazingPizza.Shared/PizzaTopping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class PizzaTopping 4 | { 5 | public Topping Topping { get; set; } 6 | 7 | public int ToppingId { get; set; } 8 | 9 | public int PizzaId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/BlazingPizza.Shared/Topping.cs: -------------------------------------------------------------------------------- 1 | namespace BlazingPizza 2 | { 3 | public class Topping 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Price { get; set; } 10 | 11 | public string GetFormattedPrice() => Price.ToString("0.00"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ui-mockup.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SQL-MisterMagoo/blazor-workshop/6bb3978f028ac2a9629df5732ba3ba2a7f2580cf/ui-mockup.pptx --------------------------------------------------------------------------------