├── .devcontainer
└── devcontainer.json
├── .github
└── workflows
│ └── dotnet.yml
├── .gitignore
├── 1-welcome
├── README.md
└── how-to-install-vs.md
├── 2-csharp
├── README.md
├── lesson-2-projects
│ ├── challenge-project
│ │ ├── Final
│ │ │ ├── Final.csproj
│ │ │ └── Program.cs
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── Starter
│ │ │ ├── Program.cs
│ │ │ └── Starter.csproj
│ └── guided-project
│ │ ├── Final
│ │ ├── Final.csproj
│ │ └── Program.cs
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── Starter
│ │ ├── Program.cs
│ │ └── Starter.csproj
├── lesson-3-projects
│ ├── challenge-project
│ │ ├── Final
│ │ │ ├── Final.csproj
│ │ │ └── Program.cs
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── Starter
│ │ │ ├── Program.cs
│ │ │ └── Starter.csproj
│ └── guided-project
│ │ ├── Final
│ │ ├── Final.csproj
│ │ └── Program.cs
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── Starter
│ │ ├── Program.cs
│ │ └── Starter.csproj
├── lesson-4-projects
│ ├── challenge-project
│ │ ├── Final
│ │ │ ├── Final.csproj
│ │ │ └── Program.cs
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── Starter
│ │ │ ├── Program.cs
│ │ │ └── Starter.csproj
│ └── guided-project
│ │ ├── Final
│ │ ├── Final.csproj
│ │ └── Program.cs
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── Starter
│ │ ├── Program.cs
│ │ └── Starter.csproj
├── lesson-5-projects
│ └── challenge-project
│ │ ├── Final
│ │ ├── Final.csproj
│ │ └── Program.cs
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── Starter
│ │ ├── Program.cs
│ │ └── Starter.csproj
└── lesson-6-projects
│ ├── challenge-project
│ ├── Final
│ │ ├── Final.csproj
│ │ └── Program.cs
│ ├── LICENSE
│ ├── README.md
│ └── Starter
│ │ ├── Program.cs
│ │ └── Starter.csproj
│ └── guided-project
│ ├── Final
│ ├── Final.csproj
│ └── Program.cs
│ ├── LICENSE
│ ├── README.md
│ └── Starter
│ ├── Program.cs
│ └── Starter.csproj
├── 3-razor-pages
├── 0-start
│ └── RazorPagesPizza
│ │ ├── RazorPagesPizza.sln
│ │ └── RazorPagesPizza
│ │ ├── Pages
│ │ ├── Error.cshtml
│ │ ├── Error.cshtml.cs
│ │ ├── Index.cshtml
│ │ ├── Index.cshtml.cs
│ │ ├── Privacy.cshtml
│ │ ├── Privacy.cshtml.cs
│ │ ├── Shared
│ │ │ ├── _Layout.cshtml
│ │ │ ├── _Layout.cshtml.css
│ │ │ └── _ValidationScriptsPartial.cshtml
│ │ ├── _ViewImports.cshtml
│ │ └── _ViewStart.cshtml
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── launchSettings.json
│ │ ├── RazorPagesPizza.csproj
│ │ ├── appsettings.Development.json
│ │ ├── appsettings.json
│ │ └── wwwroot
│ │ ├── css
│ │ └── site.css
│ │ ├── favicon.ico
│ │ ├── js
│ │ └── site.js
│ │ └── lib
│ │ ├── bootstrap
│ │ ├── LICENSE
│ │ └── dist
│ │ │ ├── css
│ │ │ ├── bootstrap-grid.css
│ │ │ ├── bootstrap-grid.css.map
│ │ │ ├── bootstrap-grid.min.css
│ │ │ ├── bootstrap-grid.min.css.map
│ │ │ ├── bootstrap-grid.rtl.css
│ │ │ ├── bootstrap-grid.rtl.css.map
│ │ │ ├── bootstrap-grid.rtl.min.css
│ │ │ ├── bootstrap-grid.rtl.min.css.map
│ │ │ ├── bootstrap-reboot.css
│ │ │ ├── bootstrap-reboot.css.map
│ │ │ ├── bootstrap-reboot.min.css
│ │ │ ├── bootstrap-reboot.min.css.map
│ │ │ ├── bootstrap-reboot.rtl.css
│ │ │ ├── bootstrap-reboot.rtl.css.map
│ │ │ ├── bootstrap-reboot.rtl.min.css
│ │ │ ├── bootstrap-reboot.rtl.min.css.map
│ │ │ ├── bootstrap-utilities.css
│ │ │ ├── bootstrap-utilities.css.map
│ │ │ ├── bootstrap-utilities.min.css
│ │ │ ├── bootstrap-utilities.min.css.map
│ │ │ ├── bootstrap-utilities.rtl.css
│ │ │ ├── bootstrap-utilities.rtl.css.map
│ │ │ ├── bootstrap-utilities.rtl.min.css
│ │ │ ├── bootstrap-utilities.rtl.min.css.map
│ │ │ ├── bootstrap.css
│ │ │ ├── bootstrap.css.map
│ │ │ ├── bootstrap.min.css
│ │ │ ├── bootstrap.min.css.map
│ │ │ ├── bootstrap.rtl.css
│ │ │ ├── bootstrap.rtl.css.map
│ │ │ ├── bootstrap.rtl.min.css
│ │ │ └── bootstrap.rtl.min.css.map
│ │ │ └── js
│ │ │ ├── bootstrap.bundle.js
│ │ │ ├── bootstrap.bundle.js.map
│ │ │ ├── bootstrap.bundle.min.js
│ │ │ ├── bootstrap.bundle.min.js.map
│ │ │ ├── bootstrap.esm.js
│ │ │ ├── bootstrap.esm.js.map
│ │ │ ├── bootstrap.esm.min.js
│ │ │ ├── bootstrap.esm.min.js.map
│ │ │ ├── bootstrap.js
│ │ │ ├── bootstrap.js.map
│ │ │ ├── bootstrap.min.js
│ │ │ └── bootstrap.min.js.map
│ │ ├── jquery-validation-unobtrusive
│ │ ├── LICENSE.txt
│ │ ├── jquery.validate.unobtrusive.js
│ │ └── jquery.validate.unobtrusive.min.js
│ │ ├── jquery-validation
│ │ ├── LICENSE.md
│ │ └── dist
│ │ │ ├── additional-methods.js
│ │ │ ├── additional-methods.min.js
│ │ │ ├── jquery.validate.js
│ │ │ └── jquery.validate.min.js
│ │ └── jquery
│ │ ├── LICENSE.txt
│ │ └── dist
│ │ ├── jquery.js
│ │ ├── jquery.min.js
│ │ └── jquery.min.map
├── 1-complete
│ └── RazorPagesPizza
│ │ ├── RazorPagesPizza.sln
│ │ └── RazorPagesPizza
│ │ ├── Data
│ │ └── RazorPagesPizzaContext.cs
│ │ ├── Migrations
│ │ ├── 20230630173639_InitialCreate.Designer.cs
│ │ ├── 20230630173639_InitialCreate.cs
│ │ └── RazorPagesPizzaContextModelSnapshot.cs
│ │ ├── Models
│ │ └── Pizza.cs
│ │ ├── Pages
│ │ ├── Create.cshtml
│ │ ├── Create.cshtml.cs
│ │ ├── Delete.cshtml
│ │ ├── Delete.cshtml.cs
│ │ ├── Details.cshtml
│ │ ├── Details.cshtml.cs
│ │ ├── Edit.cshtml
│ │ ├── Edit.cshtml.cs
│ │ ├── Error.cshtml
│ │ ├── Error.cshtml.cs
│ │ ├── Index.cshtml
│ │ ├── Index.cshtml.cs
│ │ ├── Privacy.cshtml
│ │ ├── Privacy.cshtml.cs
│ │ ├── Shared
│ │ │ ├── _Layout.cshtml
│ │ │ ├── _Layout.cshtml.css
│ │ │ └── _ValidationScriptsPartial.cshtml
│ │ ├── _ViewImports.cshtml
│ │ └── _ViewStart.cshtml
│ │ ├── Program.cs
│ │ ├── Properties
│ │ ├── launchSettings.json
│ │ ├── serviceDependencies.json
│ │ └── serviceDependencies.local.json
│ │ ├── RazorPagesPizza.csproj
│ │ ├── appsettings.Development.json
│ │ ├── appsettings.json
│ │ └── wwwroot
│ │ ├── css
│ │ └── site.css
│ │ ├── favicon.ico
│ │ ├── js
│ │ └── site.js
│ │ └── lib
│ │ ├── bootstrap
│ │ ├── LICENSE
│ │ └── dist
│ │ │ ├── css
│ │ │ ├── bootstrap-grid.css
│ │ │ ├── bootstrap-grid.css.map
│ │ │ ├── bootstrap-grid.min.css
│ │ │ ├── bootstrap-grid.min.css.map
│ │ │ ├── bootstrap-grid.rtl.css
│ │ │ ├── bootstrap-grid.rtl.css.map
│ │ │ ├── bootstrap-grid.rtl.min.css
│ │ │ ├── bootstrap-grid.rtl.min.css.map
│ │ │ ├── bootstrap-reboot.css
│ │ │ ├── bootstrap-reboot.css.map
│ │ │ ├── bootstrap-reboot.min.css
│ │ │ ├── bootstrap-reboot.min.css.map
│ │ │ ├── bootstrap-reboot.rtl.css
│ │ │ ├── bootstrap-reboot.rtl.css.map
│ │ │ ├── bootstrap-reboot.rtl.min.css
│ │ │ ├── bootstrap-reboot.rtl.min.css.map
│ │ │ ├── bootstrap-utilities.css
│ │ │ ├── bootstrap-utilities.css.map
│ │ │ ├── bootstrap-utilities.min.css
│ │ │ ├── bootstrap-utilities.min.css.map
│ │ │ ├── bootstrap-utilities.rtl.css
│ │ │ ├── bootstrap-utilities.rtl.css.map
│ │ │ ├── bootstrap-utilities.rtl.min.css
│ │ │ ├── bootstrap-utilities.rtl.min.css.map
│ │ │ ├── bootstrap.css
│ │ │ ├── bootstrap.css.map
│ │ │ ├── bootstrap.min.css
│ │ │ ├── bootstrap.min.css.map
│ │ │ ├── bootstrap.rtl.css
│ │ │ ├── bootstrap.rtl.css.map
│ │ │ ├── bootstrap.rtl.min.css
│ │ │ └── bootstrap.rtl.min.css.map
│ │ │ └── js
│ │ │ ├── bootstrap.bundle.js
│ │ │ ├── bootstrap.bundle.js.map
│ │ │ ├── bootstrap.bundle.min.js
│ │ │ ├── bootstrap.bundle.min.js.map
│ │ │ ├── bootstrap.esm.js
│ │ │ ├── bootstrap.esm.js.map
│ │ │ ├── bootstrap.esm.min.js
│ │ │ ├── bootstrap.esm.min.js.map
│ │ │ ├── bootstrap.js
│ │ │ ├── bootstrap.js.map
│ │ │ ├── bootstrap.min.js
│ │ │ └── bootstrap.min.js.map
│ │ ├── jquery-validation-unobtrusive
│ │ ├── LICENSE.txt
│ │ ├── jquery.validate.unobtrusive.js
│ │ └── jquery.validate.unobtrusive.min.js
│ │ ├── jquery-validation
│ │ ├── LICENSE.md
│ │ └── dist
│ │ │ ├── additional-methods.js
│ │ │ ├── additional-methods.min.js
│ │ │ ├── jquery.validate.js
│ │ │ └── jquery.validate.min.js
│ │ └── jquery
│ │ ├── LICENSE.txt
│ │ └── dist
│ │ ├── jquery.js
│ │ ├── jquery.min.js
│ │ └── jquery.min.map
├── README.md
├── add-scaffold.png
├── additional-info.png
├── config.png
├── new-scaffold-dialog.png
├── np.png
├── overwrite-warning.png
├── pizza-list.png
├── pmc.png
├── scaffold-settings.png
├── se.png
└── start-window-create-new-project.png
├── 4-minimal-api
├── 0-start
│ └── PizzaStore
│ │ ├── PizzaStore.csproj
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── launchSettings.json
│ │ ├── appsettings.Development.json
│ │ └── appsettings.json
├── 1-complete
│ └── PizzaStore
│ │ ├── Db.cs
│ │ ├── PizzaStore.csproj
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── launchSettings.json
│ │ ├── appsettings.Development.json
│ │ └── appsettings.json
├── README.md
├── swagger-crud.png
└── swagger.png
├── 5-blazor
├── 0-start
│ ├── Blazor.ConnectFour.sln
│ └── ConnectFour
│ │ ├── Components
│ │ ├── App.razor
│ │ ├── Board.razor
│ │ ├── Board.razor.css
│ │ ├── Layout
│ │ │ ├── MainLayout.razor
│ │ │ ├── MainLayout.razor.css
│ │ │ ├── NavMenu.razor
│ │ │ └── NavMenu.razor.css
│ │ ├── Pages
│ │ │ ├── Counter.razor
│ │ │ ├── Error.razor
│ │ │ ├── Home.razor
│ │ │ └── Weather.razor
│ │ ├── Routes.razor
│ │ └── _Imports.razor
│ │ ├── ConnectFour.csproj
│ │ ├── GameState.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── launchSettings.json
│ │ └── wwwroot
│ │ ├── app.css
│ │ ├── bootstrap
│ │ ├── bootstrap.min.css
│ │ └── bootstrap.min.css.map
│ │ └── favicon.png
├── 1-complete
│ ├── Blazor.ConnectFour.sln
│ └── ConnectFour
│ │ ├── Components
│ │ ├── App.razor
│ │ ├── Board.razor
│ │ ├── Board.razor.css
│ │ ├── Layout
│ │ │ ├── MainLayout.razor
│ │ │ ├── MainLayout.razor.css
│ │ │ ├── NavMenu.razor
│ │ │ └── NavMenu.razor.css
│ │ ├── Pages
│ │ │ ├── Error.razor
│ │ │ └── Home.razor
│ │ ├── Routes.razor
│ │ └── _Imports.razor
│ │ ├── ConnectFour.csproj
│ │ ├── GameState.cs
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── launchSettings.json
│ │ └── wwwroot
│ │ ├── app.css
│ │ ├── bootstrap
│ │ ├── bootstrap.min.css
│ │ └── bootstrap.min.css.map
│ │ └── favicon.png
├── README.md
└── img
│ ├── 1-NewTemplate.png
│ ├── 2-Board-Step1.png
│ ├── 2-Board-Step2.png
│ ├── 2-Board-Step3.png
│ ├── 2-board-drop.gif
│ ├── 3-Board-ErrorHandler.png
│ ├── 3-Board-Step1.png
│ ├── 3-Board-Step2.png
│ └── 4-Board.png
├── 6-publish
├── README.md
└── images
│ ├── azure-customer-agreement.png
│ ├── azure-start-free.png
│ ├── create-new-app-service.png
│ ├── hosting-plan.png
│ ├── publish-new-app-service.png
│ ├── sign-in-azure.png
│ ├── solution-explorer-publish.png
│ └── specific-target.png
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── SECURITY.md
└── images
├── dotnet-bot.svg
├── dotnet-bot_jetpack-faceing-right.svg
├── intro-thumbnail.jpg
└── what-is-dotnet.png
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2 | // README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
3 | {
4 | "name": "Intro to .NET webdev",
5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6 | "image": "mcr.microsoft.com/devcontainers/dotnet:8.0",
7 |
8 | // Features to add to the dev container. More info: https://containers.dev/features.
9 | "features": {},
10 |
11 | "customizations": {
12 | "vscode": {
13 | "extensions": [
14 | "ms-dotnettools.csdevkit"
15 | ]
16 | }
17 | },
18 | "forwardPorts": [
19 | 5007,
20 | 5101,
21 | 5112
22 | ],
23 | "postCreateCommand": "dotnet restore",
24 | "portsAttributes": {
25 | "5007": {
26 | "label": "Blazor Connect Four"
27 | },
28 | "5101": {
29 | "label": "RazorPagesPizza"
30 | },
31 | "5112": {
32 | "label": "Pizza API"
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/.github/workflows/dotnet.yml:
--------------------------------------------------------------------------------
1 | # This workflow will build a .NET project
2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3 |
4 | name: .NET Build
5 |
6 | on:
7 | push:
8 | branches: [ main ]
9 | pull_request:
10 | branches: [ main ]
11 |
12 | env:
13 | DOTNET_VERSION: '8.0.x' # The .NET SDK version to use
14 |
15 | jobs:
16 | build:
17 | name: Build All Projects
18 | runs-on: ubuntu-latest
19 |
20 | strategy:
21 | fail-fast: false
22 | matrix:
23 | project:
24 | - 3-razor-pages/0-start/RazorPagesPizza/RazorPagesPizza/RazorPagesPizza.csproj
25 | - 3-razor-pages/1-complete/RazorPagesPizza/RazorPagesPizza/RazorPagesPizza.csproj
26 | - 4-minimal-api/0-start/PizzaStore/PizzaStore.csproj
27 | - 4-minimal-api/1-complete/PizzaStore/PizzaStore.csproj
28 | - 5-blazor/0-start/ConnectFour/ConnectFour.csproj
29 | - 5-blazor/1-complete/ConnectFour/ConnectFour.csproj
30 |
31 | steps:
32 | - uses: actions/checkout@v3
33 | - name: Setup .NET
34 | uses: actions/setup-dotnet@v3
35 | with:
36 | dotnet-version: ${{ env.DOTNET_VERSION }}
37 | - name: Build ${{ matrix.project }}
38 | run: dotnet build "${{ matrix.project }}"
39 |
--------------------------------------------------------------------------------
/1-welcome/README.md:
--------------------------------------------------------------------------------
1 | # Welcome to the Intro to Web Dev with .NET series
2 | In this Welcome, we’ll introduce ourselves, give you the lesson rundown, take you on a tour of the .NET ecosystem, and show you all the tools you’ll need to build the projects.
3 |
4 | 
5 |
6 | ## Prerequisite tools
7 | In this series, you can use your editor of choice or GitHub Codespaces. Here are some options we suggest:
8 | - [GitHub Codespaces](https://code.visualstudio.com/docs/remote/codespaces) for an in-browser coding environment
9 | - [Visual Studio Code](https://code.visualstudio.com/), with the [C# Dev Kit Extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)
10 | - [Visual Studio](https://aka.ms/WebLearningSeries-git-vsDownload) - check out our [more detailed instructions](/1-welcome/how-to-install-vs.md) for extra help
11 | - [.NET SDK](https://dot.net/download)
12 |
13 | During the series you will learn the basics of C#, building websites and web APIs, and even how to publish your apps to the cloud. Here is a rundown of what the next few weeks will look like.
14 |
15 | ## Who are we?
16 | Let us introduce ourselves. The content in this series is all written by .NET Developer Community Team from Microsoft. More specifically, Jon, James, Jeff, and Katie will be teaching you web development and all things .NET.
17 |
18 | ## What to expect
19 | - Week 1 – Welcome!
20 | - Week 2 – C# for web development crash course
21 | - Week 3 – We'll build our first pizza website with Razor Pages 🍕
22 | - Week 4 – Upgrade our pizza website with a backend using Minimal web APIs
23 | - Week 5 – Create a Connect 4 Interactive Web Applications with Blazor
24 | - Week 6 – Connect to the cloud by publishing with Azure
25 |
26 | To start you on your journey I want to give you a brief overview of what C# and .NET are, and what tools you will need to get going.
27 |
28 | ## What is .NET?
29 | .NET is a free, cross-platform, open source developer platform for building many different types of applications. This platform is used by companies of all different industries and different sizes. If you’ve ever used Stack Overflow, eaten Chipotle, or received a package delivered by UPS, then you’ve interacted with .NET!
30 |
31 | With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, games, IoT, and more!
32 |
33 | 
34 |
35 | For this series we’ll use ASP.NET Core and Blazor to build web apps!
36 |
--------------------------------------------------------------------------------
/1-welcome/how-to-install-vs.md:
--------------------------------------------------------------------------------
1 | # Install Visual Studio
2 |
3 | If you're using Windows for development, we recommend using Visual Studio for .NET development. Alternatively, you can use Visual Studio Code on Windows, macOS, and Linux.
4 |
5 | ## To set up Visual Studio on Windows
6 | 1. Go to the [Develop .NET applications page](https://visualstudio.microsoft.com/vs/features/net-development/) of the Visual Studio website
7 | 1. Find the "Download Visual Studio with .NET" dropdown and select "Community 2022"
8 | 1. Run the exe and let Visual Studio download
9 | 1. Wait for everything to install
10 | 1. Sign in to Visual Studio
11 | 1. Done ✔️
12 |
13 | ## To set up Visual Studio Code on Windows, macOS, or Linux
14 | 1. Install the [.NET SDK](https://dot.net/download)
15 | 1. Install [Visual Studio Code](https://code.visualstudio.com)
16 | 1. Install the [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit) extension
17 | 1. Done ✔️
18 |
19 | ## Want more help?
20 | If you want more detailed installation instructions, check out the Microsoft Documentation.
21 | * [Install Visual Studio](https://docs.microsoft.com/visualstudio/install/install-visual-studio?view=vs-2022)
22 | * [Getting Started with C# in VS Code](https://code.visualstudio.com/docs/csharp/get-started)
23 |
24 | Check out the [Learn to code in Visual Studio](https://visualstudio.microsoft.com/vs/getting-started/) page to learn more about the installation process, how to get started with Visual Studio, and how to make it your own with themes! 🤗
25 |
--------------------------------------------------------------------------------
/2-csharp/lesson-2-projects/challenge-project/Final/Final.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-2-projects/challenge-project/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Microsoft Learning
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/2-csharp/lesson-2-projects/challenge-project/README.md:
--------------------------------------------------------------------------------
1 | # Challenge-project-foreach-if-array-CSharp
2 | Starter and Solution code for the Challenge project: "Develop foreach and if-elseif-else structures to process array data in C#" from the Microsoft Learn collection "Getting started with C#"
3 |
--------------------------------------------------------------------------------
/2-csharp/lesson-2-projects/challenge-project/Starter/Program.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This C# console application is designed to:
3 | - Use arrays to store student names and assignment scores.
4 | - Use a `foreach` statement to iterate through the student names as an outer program loop.
5 | - Use an `if` statement within the outer loop to identify the current student name and access that student's assignment scores.
6 | - Use a `foreach` statement within the outer loop to iterate though the assignment scores array and sum the values.
7 | - Use an algorithm within the outer loop to calculate the average exam score for each student.
8 | - Use an `if-elseif-else` construct within the outer loop to evaluate the average exam score and assign a letter grade automatically.
9 | - Integrate extra credit scores when calculating the student's final score and letter grade as follows:
10 | - detects extra credit assignments based on the number of elements in the student's scores array.
11 | - divides the values of extra credit assignments by 10 before adding extra credit scores to the sum of exam scores.
12 | - use the following report format to report student grades:
13 |
14 | Student Grade
15 |
16 | Sophia: 92.2 A-
17 | Andrew: 89.6 B+
18 | Emma: 85.6 B
19 | Logan: 91.2 A-
20 | */
21 | int examAssignments = 5;
22 |
23 | string[] studentNames = new string[] { "Sophia", "Andrew", "Emma", "Logan" };
24 |
25 | int[] sophiaScores = new int[] { 90, 86, 87, 98, 100, 94, 90 };
26 | int[] andrewScores = new int[] { 92, 89, 81, 96, 90, 89 };
27 | int[] emmaScores = new int[] { 90, 85, 87, 98, 68, 89, 89, 89 };
28 | int[] loganScores = new int[] { 90, 95, 87, 88, 96, 96 };
29 |
30 | int[] studentScores = new int[10];
31 |
32 | string currentStudentLetterGrade = "";
33 |
34 | // display the header row for scores/grades
35 | Console.Clear();
36 | Console.WriteLine("Student\t\tGrade\tLetter Grade\n");
37 |
38 | /*
39 | The outer foreach loop is used to:
40 | - iterate through student names
41 | - assign a student's grades to the studentScores array
42 | - sum assignment scores (inner foreach loop)
43 | - calculate numeric and letter grade
44 | - write the score report information
45 | */
46 | foreach (string name in studentNames)
47 | {
48 | string currentStudent = name;
49 |
50 | if (currentStudent == "Sophia")
51 | studentScores = sophiaScores;
52 |
53 | else if (currentStudent == "Andrew")
54 | studentScores = andrewScores;
55 |
56 | else if (currentStudent == "Emma")
57 | studentScores = emmaScores;
58 |
59 | else if (currentStudent == "Logan")
60 | studentScores = loganScores;
61 |
62 | int sumAssignmentScores = 0;
63 |
64 | decimal currentStudentGrade = 0;
65 |
66 | int gradedAssignments = 0;
67 |
68 | /*
69 | the inner foreach loop sums assignment scores
70 | extra credit assignments are worth 10% of an exam score
71 | */
72 | foreach (int score in studentScores)
73 | {
74 | gradedAssignments += 1;
75 |
76 | if (gradedAssignments <= examAssignments)
77 | sumAssignmentScores += score;
78 |
79 | else
80 | sumAssignmentScores += score / 10;
81 | }
82 |
83 | currentStudentGrade = (decimal)(sumAssignmentScores) / examAssignments;
84 |
85 | if (currentStudentGrade >= 97)
86 | currentStudentLetterGrade = "A+";
87 |
88 | else if (currentStudentGrade >= 93)
89 | currentStudentLetterGrade = "A";
90 |
91 | else if (currentStudentGrade >= 90)
92 | currentStudentLetterGrade = "A-";
93 |
94 | else if (currentStudentGrade >= 87)
95 | currentStudentLetterGrade = "B+";
96 |
97 | else if (currentStudentGrade >= 83)
98 | currentStudentLetterGrade = "B";
99 |
100 | else if (currentStudentGrade >= 80)
101 | currentStudentLetterGrade = "B-";
102 |
103 | else if (currentStudentGrade >= 77)
104 | currentStudentLetterGrade = "C+";
105 |
106 | else if (currentStudentGrade >= 73)
107 | currentStudentLetterGrade = "C";
108 |
109 | else if (currentStudentGrade >= 70)
110 | currentStudentLetterGrade = "C-";
111 |
112 | else if (currentStudentGrade >= 67)
113 | currentStudentLetterGrade = "D+";
114 |
115 | else if (currentStudentGrade >= 63)
116 | currentStudentLetterGrade = "D";
117 |
118 | else if (currentStudentGrade >= 60)
119 | currentStudentLetterGrade = "D-";
120 |
121 | else
122 | currentStudentLetterGrade = "F";
123 |
124 | // Student Grade
125 | // Sophia: 92.2 A-
126 |
127 | Console.WriteLine($"{currentStudent}\t\t{currentStudentGrade}\t{currentStudentLetterGrade}");
128 | }
129 |
130 | // required for running in VS Code (keeps the Output windows open to view results)
131 | Console.WriteLine("\n\rPress the Enter key to continue");
132 | Console.ReadLine();
133 |
--------------------------------------------------------------------------------
/2-csharp/lesson-2-projects/challenge-project/Starter/Starter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-2-projects/guided-project/Final/Final.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-2-projects/guided-project/Final/Program.cs:
--------------------------------------------------------------------------------
1 | /*
2 | This C# console application is designed to:
3 | - Use arrays to store student names and assignment scores.
4 | - Use a `foreach` statement to iterate through the student names as an outer program loop.
5 | - Use an `if` statement within the outer loop to identify the current student name and access that student's assignment scores.
6 | - Use a `foreach` statement within the outer loop to iterate though the assignment scores array and sum the values.
7 | - Use an algorithm within the outer loop to calculate the average exam score for each student.
8 | - Use an `if-elseif-else` construct within the outer loop to evaluate the average exam score and assign a letter grade automatically.
9 | - Integrate extra credit scores when calculating the student's final score and letter grade as follows:
10 | - detects extra credit assignments based on the number of elements in the student's scores array.
11 | - divides the values of extra credit assignments by 10 before adding extra credit scores to the sum of exam scores.
12 | - use the following report format to report student grades:
13 |
14 | Student Grade
15 |
16 | Sophia: 92.2 A-
17 | Andrew: 89.6 B+
18 | Emma: 85.6 B
19 | Logan: 91.2 A-
20 | */
21 |
22 | int examAssignments = 5;
23 |
24 | string[] studentNames = new string[] { "Sophia", "Andrew", "Emma", "Logan" };
25 |
26 | int[] sophiaScores = new int[] { 90, 86, 87, 98, 100, 94, 90 };
27 | int[] andrewScores = new int[] { 92, 89, 81, 96, 90, 89 };
28 | int[] emmaScores = new int[] { 90, 85, 87, 98, 68, 89, 89, 89 };
29 | int[] loganScores = new int[] { 90, 95, 87, 88, 96, 96 };
30 |
31 | int[] studentScores = new int[10];
32 |
33 | string currentStudentLetterGrade = "";
34 |
35 | // display the header row for scores/grades
36 | Console.Clear();
37 | Console.WriteLine("Student\t\tGrade\n");
38 |
39 | /*
40 | The outer foreach loop is used to:
41 | - iterate through student names
42 | - assign a student's grades to the studentScores array
43 | - sum assignment scores (inner foreach loop)
44 | - calculate numeric and letter grade
45 | - write the score report information
46 | */
47 | foreach (string name in studentNames)
48 | {
49 | string currentStudent = name;
50 |
51 | if (currentStudent == "Sophia")
52 | studentScores = sophiaScores;
53 |
54 | else if (currentStudent == "Andrew")
55 | studentScores = andrewScores;
56 |
57 | else if (currentStudent == "Emma")
58 | studentScores = emmaScores;
59 |
60 | else if (currentStudent == "Logan")
61 | studentScores = loganScores;
62 |
63 | int sumAssignmentScores = 0;
64 | decimal currentStudentGrade = 0;
65 | int gradedAssignments = 0;
66 |
67 | /*
68 | the inner foreach loop sums assignment scores
69 | extra credit assignments are worth 10% of an exam score
70 | */
71 | foreach (int score in studentScores)
72 | {
73 | gradedAssignments += 1;
74 |
75 | if (gradedAssignments <= examAssignments)
76 | sumAssignmentScores += score;
77 | else
78 | sumAssignmentScores += score / 10;
79 | }
80 |
81 | currentStudentGrade = (decimal)(sumAssignmentScores) / examAssignments;
82 |
83 | if (currentStudentGrade >= 97)
84 | currentStudentLetterGrade = "A+";
85 | else if (currentStudentGrade >= 93)
86 | currentStudentLetterGrade = "A";
87 | else if (currentStudentGrade >= 90)
88 | currentStudentLetterGrade = "A-";
89 | else if (currentStudentGrade >= 87)
90 | currentStudentLetterGrade = "B+";
91 | else if (currentStudentGrade >= 83)
92 | currentStudentLetterGrade = "B";
93 | else if (currentStudentGrade >= 80)
94 | currentStudentLetterGrade = "B-";
95 | else if (currentStudentGrade >= 77)
96 | currentStudentLetterGrade = "C+";
97 | else if (currentStudentGrade >= 73)
98 | currentStudentLetterGrade = "C";
99 | else if (currentStudentGrade >= 70)
100 | currentStudentLetterGrade = "C-";
101 | else if (currentStudentGrade >= 67)
102 | currentStudentLetterGrade = "D+";
103 | else if (currentStudentGrade >= 63)
104 | currentStudentLetterGrade = "D";
105 | else if (currentStudentGrade >= 60)
106 | currentStudentLetterGrade = "D-";
107 | else
108 | currentStudentLetterGrade = "F";
109 |
110 | // Student Grade
111 | // Sophia: 92.2 A-
112 |
113 | Console.WriteLine($"{currentStudent}\t\t{currentStudentGrade}\t{currentStudentLetterGrade}");
114 | }
115 |
116 | // required for running in VS Code (keeps the Output windows open to view results)
117 | Console.WriteLine("\n\rPress the Enter key to continue");
118 | Console.ReadLine();
119 |
--------------------------------------------------------------------------------
/2-csharp/lesson-2-projects/guided-project/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Microsoft Learning
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/2-csharp/lesson-2-projects/guided-project/README.md:
--------------------------------------------------------------------------------
1 | # Guided-project-foreach-if-array-CSharp
2 | Starter and Solution code for the Guided project: "Develop foreach and if-elseif-else structures to process array data in C#" from the Microsoft Learn collection "Getting started with C#"
3 |
--------------------------------------------------------------------------------
/2-csharp/lesson-2-projects/guided-project/Starter/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | // initialize variables - graded assignments
4 | int currentAssignments = 5;
5 |
6 | int sophia1 = 90;
7 | int sophia2 = 86;
8 | int sophia3 = 87;
9 | int sophia4 = 98;
10 | int sophia5 = 100;
11 |
12 | int andrew1 = 92;
13 | int andrew2 = 89;
14 | int andrew3 = 81;
15 | int andrew4 = 96;
16 | int andrew5 = 90;
17 |
18 | int emma1 = 90;
19 | int emma2 = 85;
20 | int emma3 = 87;
21 | int emma4 = 98;
22 | int emma5 = 68;
23 |
24 | int logan1 = 90;
25 | int logan2 = 95;
26 | int logan3 = 87;
27 | int logan4 = 88;
28 | int logan5 = 96;
29 |
30 | int sophiaSum = 0;
31 | int andrewSum = 0;
32 | int emmaSum = 0;
33 | int loganSum = 0;
34 |
35 | decimal sophiaScore;
36 | decimal andrewScore;
37 | decimal emmaScore;
38 | decimal loganScore;
39 |
40 | sophiaSum = sophia1 + sophia2 + sophia3 + sophia4 + sophia5;
41 | andrewSum = andrew1 + andrew2 + andrew3 + andrew4 + andrew5;
42 | emmaSum = emma1 + emma2 + emma3 + emma4 + emma5;
43 | loganSum = logan1 + logan2 + logan3 + logan4 + logan5;
44 |
45 | sophiaScore = (decimal)sophiaSum / currentAssignments;
46 | andrewScore = (decimal)andrewSum / currentAssignments;
47 | emmaScore = (decimal)emmaSum / currentAssignments;
48 | loganScore = (decimal)loganSum / currentAssignments;
49 |
50 | Console.WriteLine("Student\t\tGrade\n");
51 | Console.WriteLine("Sophia:\t\t" + sophiaScore + "\tA-");
52 | Console.WriteLine("Andrew:\t\t" + andrewScore + "\tB+");
53 | Console.WriteLine("Emma:\t\t" + emmaScore + "\tB");
54 | Console.WriteLine("Logan:\t\t" + loganScore + "\tA-");
55 |
56 | Console.WriteLine("Press the Enter key to continue");
57 | Console.ReadLine();
58 |
--------------------------------------------------------------------------------
/2-csharp/lesson-2-projects/guided-project/Starter/Starter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-3-projects/challenge-project/Final/Final.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-3-projects/challenge-project/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Microsoft Learning
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/2-csharp/lesson-3-projects/challenge-project/README.md:
--------------------------------------------------------------------------------
1 | # Challenge-project-branching-looping-CSharp
2 | Starter and Solution code for the Challenge project: "Develop conditional branching and looping structures in C#" from the Microsoft Learn collection "Getting started with C#"
3 |
--------------------------------------------------------------------------------
/2-csharp/lesson-3-projects/challenge-project/Starter/Starter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-3-projects/guided-project/Final/Final.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-3-projects/guided-project/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Microsoft Learning
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/2-csharp/lesson-3-projects/guided-project/README.md:
--------------------------------------------------------------------------------
1 | # Guided-project-branching-looping-CSharp
2 | Starter and Solution code for the Guided project: "Develop conditional branching and looping structures in C#" from the Microsoft Learn collection "Getting started with C#"
3 |
--------------------------------------------------------------------------------
/2-csharp/lesson-3-projects/guided-project/Starter/Program.cs:
--------------------------------------------------------------------------------
1 | // the ourAnimals array will store the following:
2 | string animalSpecies = "";
3 | string animalID = "";
4 | string animalAge = "";
5 | string animalPhysicalDescription = "";
6 | string animalPersonalityDescription = "";
7 | string animalNickname = "";
8 |
9 | // variables that support data entry
10 | int maxPets = 8;
11 | string? readResult;
12 | string menuSelection = "";
13 |
14 | // array used to store runtime data, there is no persisted data
15 | string[,] ourAnimals = new string[maxPets, 6];
16 |
17 | // TODO: Convert the if-elseif-else construct to a switch statement
18 |
19 | // create some initial ourAnimals array entries
20 | for (int i = 0; i < maxPets; i++)
21 | {
22 | if (i == 0)
23 | {
24 | animalSpecies = "dog";
25 | animalID = "d1";
26 | animalAge = "2";
27 | animalPhysicalDescription = "medium sized cream colored female golden retriever weighing about 65 pounds. housebroken.";
28 | animalPersonalityDescription = "loves to have her belly rubbed and likes to chase her tail. gives lots of kisses.";
29 | animalNickname = "lola";
30 | }
31 | else if (i == 1)
32 | {
33 | animalSpecies = "dog";
34 | animalID = "d2";
35 | animalAge = "9";
36 | animalPhysicalDescription = "large reddish-brown male golden retriever weighing about 85 pounds. housebroken.";
37 | animalPersonalityDescription = "loves to have his ears rubbed when he greets you at the door, or at any time! loves to lean-in and give doggy hugs.";
38 | animalNickname = "loki";
39 | }
40 | else if (i == 2)
41 | {
42 | animalSpecies = "cat";
43 | animalID = "c3";
44 | animalAge = "1";
45 | animalPhysicalDescription = "small white female weighing about 8 pounds. litter box trained.";
46 | animalPersonalityDescription = "friendly";
47 | animalNickname = "Puss";
48 | }
49 | else if (i == 3)
50 | {
51 | animalSpecies = "cat";
52 | animalID = "c4";
53 | animalAge = "?";
54 | animalPhysicalDescription = "";
55 | animalPersonalityDescription = "";
56 | animalNickname = "";
57 | }
58 | else
59 | {
60 | animalSpecies = "";
61 | animalID = "";
62 | animalAge = "";
63 | animalPhysicalDescription = "";
64 | animalPersonalityDescription = "";
65 | animalNickname = "";
66 | }
67 |
68 | ourAnimals[i, 0] = "ID #: " + animalID;
69 | ourAnimals[i, 1] = "Species: " + animalSpecies;
70 | ourAnimals[i, 2] = "Age: " + animalAge;
71 | ourAnimals[i, 3] = "Nickname: " + animalNickname;
72 | ourAnimals[i, 4] = "Physical description: " + animalPhysicalDescription;
73 | ourAnimals[i, 5] = "Personality: " + animalPersonalityDescription;
74 | }
75 |
76 | // display the top-level menu options
77 |
78 | Console.Clear();
79 |
80 | Console.WriteLine("Welcome to the Contoso PetFriends app. Your main menu options are:");
81 | Console.WriteLine(" 1. List all of our current pet information");
82 | Console.WriteLine(" 2. Add a new animal friend to the ourAnimals array");
83 | Console.WriteLine(" 3. Ensure animal ages and physical descriptions are complete");
84 | Console.WriteLine(" 4. Ensure animal nicknames and personality descriptions are complete");
85 | Console.WriteLine(" 5. Edit an animal’s age");
86 | Console.WriteLine(" 6. Edit an animal’s personality description");
87 | Console.WriteLine(" 7. Display all cats with a specified characteristic");
88 | Console.WriteLine(" 8. Display all dogs with a specified characteristic");
89 | Console.WriteLine();
90 | Console.WriteLine("Enter your selection number (or type Exit to exit the program)");
91 |
92 | readResult = Console.ReadLine();
93 | if (readResult != null)
94 | {
95 | menuSelection = readResult.ToLower();
96 | }
97 |
98 | Console.WriteLine($"You selected menu option {menuSelection}.");
99 | Console.WriteLine("Press the Enter key to continue");
100 |
101 | // pause code execution
102 | readResult = Console.ReadLine();
103 |
--------------------------------------------------------------------------------
/2-csharp/lesson-3-projects/guided-project/Starter/Starter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-4-projects/challenge-project/Final/Final.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-4-projects/challenge-project/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Microsoft Learning
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/2-csharp/lesson-4-projects/challenge-project/README.md:
--------------------------------------------------------------------------------
1 | # Challenge-project-Work-with-variable-data-in-CSharp
2 | Starter and Solution code for the **Challenge project**: "Work with variable data in C# console applications" from the Microsoft Learn collection "Getting started with C#"
3 |
--------------------------------------------------------------------------------
/2-csharp/lesson-4-projects/challenge-project/Starter/Starter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-4-projects/guided-project/Final/Final.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-4-projects/guided-project/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Microsoft Learning
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/2-csharp/lesson-4-projects/guided-project/README.md:
--------------------------------------------------------------------------------
1 | # Guided-project-Work-with-variable-data-in-CSharp
2 |
3 | Starter and Solution code for the **Guided project**: "Work with variable data in C# console applications" from the Microsoft Learn collection "Getting started with C#"
4 |
--------------------------------------------------------------------------------
/2-csharp/lesson-4-projects/guided-project/Starter/Program.cs:
--------------------------------------------------------------------------------
1 | // #1 the ourAnimals array will store the following:
2 | string animalSpecies = "";
3 | string animalID = "";
4 | string animalAge = "";
5 | string animalPhysicalDescription = "";
6 | string animalPersonalityDescription = "";
7 | string animalNickname = "";
8 |
9 | // #2 variables that support data entry
10 | int maxPets = 8;
11 | string? readResult;
12 | string menuSelection = "";
13 |
14 | // #3 array used to store runtime data, there is no persisted data
15 | string[,] ourAnimals = new string[maxPets, 6];
16 |
17 | // #4 create sample data ourAnimals array entries
18 | for (int i = 0; i < maxPets; i++)
19 | {
20 | switch (i)
21 | {
22 | case 0:
23 | animalSpecies = "dog";
24 | animalID = "d1";
25 | animalAge = "2";
26 | animalPhysicalDescription = "medium sized cream colored female golden retriever weighing about 45 pounds. housebroken.";
27 | animalPersonalityDescription = "loves to have her belly rubbed and likes to chase her tail. gives lots of kisses.";
28 | animalNickname = "lola";
29 | break;
30 |
31 | case 1:
32 | animalSpecies = "dog";
33 | animalID = "d2";
34 | animalAge = "9";
35 | animalPhysicalDescription = "large reddish-brown male golden retriever weighing about 85 pounds. housebroken.";
36 | animalPersonalityDescription = "loves to have his ears rubbed when he greets you at the door, or at any time! loves to lean-in and give doggy hugs.";
37 | animalNickname = "gus";
38 | break;
39 |
40 | case 2:
41 | animalSpecies = "cat";
42 | animalID = "c3";
43 | animalAge = "1";
44 | animalPhysicalDescription = "small white female weighing about 8 pounds. litter box trained.";
45 | animalPersonalityDescription = "friendly";
46 | animalNickname = "snow";
47 | break;
48 |
49 | case 3:
50 | animalSpecies = "cat";
51 | animalID = "c4";
52 | animalAge = "3";
53 | animalPhysicalDescription = "Medium sized, long hair, yellow, female, about 10 pounds. Uses litter box.";
54 | animalPersonalityDescription = "A people loving cat that likes to sit on your lap.";
55 | animalNickname = "Lion";
56 | break;
57 |
58 | default:
59 | animalSpecies = "";
60 | animalID = "";
61 | animalAge = "";
62 | animalPhysicalDescription = "";
63 | animalPersonalityDescription = "";
64 | animalNickname = "";
65 | break;
66 |
67 | }
68 |
69 | ourAnimals[i, 0] = "ID #: " + animalID;
70 | ourAnimals[i, 1] = "Species: " + animalSpecies;
71 | ourAnimals[i, 2] = "Age: " + animalAge;
72 | ourAnimals[i, 3] = "Nickname: " + animalNickname;
73 | ourAnimals[i, 4] = "Physical description: " + animalPhysicalDescription;
74 | ourAnimals[i, 5] = "Personality: " + animalPersonalityDescription;
75 |
76 | }
77 |
78 | // #5 display the top-level menu options
79 | do
80 | {
81 | // NOTE: the Console.Clear method is throwing an exception in debug sessions
82 | Console.Clear();
83 |
84 | Console.WriteLine("Welcome to the Contoso PetFriends app. Your main menu options are:");
85 | Console.WriteLine(" 1. List all of our current pet information");
86 | Console.WriteLine(" 2. Display all dogs with a specified characteristic");
87 | Console.WriteLine();
88 | Console.WriteLine("Enter your selection number (or type Exit to exit the program)");
89 |
90 | readResult = Console.ReadLine();
91 | if (readResult != null)
92 | {
93 | menuSelection = readResult.ToLower();
94 | }
95 |
96 | // use switch-case to process the selected menu option
97 | switch (menuSelection)
98 | {
99 | case "1":
100 | // list all pet info
101 | for (int i = 0; i < maxPets; i++)
102 | {
103 | if (ourAnimals[i, 0] != "ID #: ")
104 | {
105 | Console.WriteLine();
106 | for (int j = 0; j < 6; j++)
107 | {
108 | Console.WriteLine(ourAnimals[i, j]);
109 | }
110 | }
111 | }
112 | Console.WriteLine("\n\rPress the Enter key to continue");
113 | readResult = Console.ReadLine();
114 |
115 | break;
116 |
117 | case "2":
118 | // Display all dogs with a specified characteristic
119 | Console.WriteLine("\nUNDER CONSTRUCTION - please check back next month to see progress.");
120 | Console.WriteLine("Press the Enter key to continue.");
121 | readResult = Console.ReadLine();
122 | break;
123 |
124 | default:
125 | break;
126 | }
127 |
128 | } while (menuSelection != "exit");
129 |
--------------------------------------------------------------------------------
/2-csharp/lesson-4-projects/guided-project/Starter/Starter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-5-projects/challenge-project/Final/Final.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-5-projects/challenge-project/Final/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | Random random = new Random();
4 | Console.CursorVisible = false;
5 | int height = Console.WindowHeight - 1;
6 | int width = Console.WindowWidth - 5;
7 | bool shouldExit = false;
8 |
9 | // Console position of the player
10 | int playerX = 0;
11 | int playerY = 0;
12 |
13 | // Console position of the food
14 | int foodX = 0;
15 | int foodY = 0;
16 |
17 | // Available player and food strings
18 | string[] states = {"('-')", "(^-^)", "(X_X)"};
19 | string[] foods = {"@@@@@", "$$$$$", "#####"};
20 |
21 | // Current player string displayed in the Console
22 | string player = states[0];
23 |
24 | // Index of the current food
25 | int food = 0;
26 |
27 | InitializeGame();
28 | while (!shouldExit)
29 | {
30 | if (TerminalResized())
31 | {
32 | Console.Clear();
33 | Console.Write("Console was resized. Program exiting.");
34 | shouldExit = true;
35 | }
36 | else
37 | {
38 | if (PlayerIsFaster())
39 | {
40 | Move(1, false);
41 | }
42 | else if (PlayerIsSick())
43 | {
44 | FreezePlayer();
45 | } else
46 | {
47 | Move(otherKeysExit: false);
48 | }
49 | if (GotFood())
50 | {
51 | ChangePlayer();
52 | ShowFood();
53 | }
54 | }
55 | }
56 |
57 | // Returns true if the Terminal was resized
58 | bool TerminalResized()
59 | {
60 | return height != Console.WindowHeight - 1 || width != Console.WindowWidth - 5;
61 | }
62 |
63 | // Displays random food at a random location
64 | void ShowFood()
65 | {
66 | // Update food to a random index
67 | food = random.Next(0, foods.Length);
68 |
69 | // Update food position to a random location
70 | foodX = random.Next(0, width - player.Length);
71 | foodY = random.Next(0, height - 1);
72 |
73 | // Display the food at the location
74 | Console.SetCursorPosition(foodX, foodY);
75 | Console.Write(foods[food]);
76 | }
77 |
78 | // Returns true if the player location matches the food location
79 | bool GotFood()
80 | {
81 | return playerY == foodY && playerX == foodX;
82 | }
83 |
84 | // Returns true if the player appearance represents a sick state
85 | bool PlayerIsSick()
86 | {
87 | return player.Equals(states[2]);
88 | }
89 |
90 | // Returns true if the player appearance represents a fast state
91 | bool PlayerIsFaster()
92 | {
93 | return player.Equals(states[1]);
94 | }
95 |
96 | // Changes the player to match the food consumed
97 | void ChangePlayer()
98 | {
99 | player = states[food];
100 | Console.SetCursorPosition(playerX, playerY);
101 | Console.Write(player);
102 | }
103 |
104 | // Temporarily stops the player from moving
105 | void FreezePlayer()
106 | {
107 | System.Threading.Thread.Sleep(1000);
108 | player = states[0];
109 | }
110 |
111 | // Reads directional input from the Console and moves the player
112 | void Move(int speed = 1, bool otherKeysExit = false)
113 | {
114 | int lastX = playerX;
115 | int lastY = playerY;
116 |
117 | switch (Console.ReadKey(true).Key) {
118 | case ConsoleKey.UpArrow:
119 | playerY--;
120 | break;
121 | case ConsoleKey.DownArrow:
122 | playerY++;
123 | break;
124 | case ConsoleKey.LeftArrow:
125 | playerX -= speed;
126 | break;
127 | case ConsoleKey.RightArrow:
128 | playerX += speed;
129 | break;
130 | case ConsoleKey.Escape:
131 | shouldExit = true;
132 | break;
133 | default:
134 | // Exit if any other keys are pressed
135 | shouldExit = otherKeysExit;
136 | break;
137 | }
138 |
139 | // Clear the characters at the previous position
140 | Console.SetCursorPosition(lastX, lastY);
141 | for (int i = 0; i < player.Length; i++)
142 | {
143 | Console.Write(" ");
144 | }
145 |
146 | // Keep player position within the bounds of the Terminal window
147 | playerX = (playerX < 0) ? 0 : (playerX >= width ? width : playerX);
148 | playerY = (playerY < 0) ? 0 : (playerY >= height ? height : playerY);
149 |
150 | // Draw the player at the new location
151 | Console.SetCursorPosition(playerX, playerY);
152 | Console.Write(player);
153 | }
154 |
155 | // Clears the console, displays the food and player
156 | void InitializeGame()
157 | {
158 | Console.Clear();
159 | ShowFood();
160 | Console.SetCursorPosition(0, 0);
161 | Console.Write(player);
162 | }
--------------------------------------------------------------------------------
/2-csharp/lesson-5-projects/challenge-project/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Microsoft Learning
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/2-csharp/lesson-5-projects/challenge-project/README.md:
--------------------------------------------------------------------------------
1 | # Challenge-project-Create-methods-in-CSharp
2 |
3 | Starter and Final code for the Challenge project: "Create methods C# console applications" from the Microsoft Learn collection "Getting started with C#"
4 |
--------------------------------------------------------------------------------
/2-csharp/lesson-5-projects/challenge-project/Starter/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | Random random = new Random();
4 | Console.CursorVisible = false;
5 | int height = Console.WindowHeight - 1;
6 | int width = Console.WindowWidth - 5;
7 | bool shouldExit = false;
8 |
9 | // Console position of the player
10 | int playerX = 0;
11 | int playerY = 0;
12 |
13 | // Console position of the food
14 | int foodX = 0;
15 | int foodY = 0;
16 |
17 | // Available player and food strings
18 | string[] states = {"('-')", "(^-^)", "(X_X)"};
19 | string[] foods = {"@@@@@", "$$$$$", "#####"};
20 |
21 | // Current player string displayed in the Console
22 | string player = states[0];
23 |
24 | // Index of the current food
25 | int food = 0;
26 |
27 | InitializeGame();
28 | while (!shouldExit)
29 | {
30 | Move();
31 | }
32 |
33 | // Returns true if the Terminal was resized
34 | bool TerminalResized()
35 | {
36 | return height != Console.WindowHeight - 1 || width != Console.WindowWidth - 5;
37 | }
38 |
39 | // Displays random food at a random location
40 | void ShowFood()
41 | {
42 | // Update food to a random index
43 | food = random.Next(0, foods.Length);
44 |
45 | // Update food position to a random location
46 | foodX = random.Next(0, width - player.Length);
47 | foodY = random.Next(0, height - 1);
48 |
49 | // Display the food at the location
50 | Console.SetCursorPosition(foodX, foodY);
51 | Console.Write(foods[food]);
52 | }
53 |
54 | // Changes the player to match the food consumed
55 | void ChangePlayer()
56 | {
57 | player = states[food];
58 | Console.SetCursorPosition(playerX, playerY);
59 | Console.Write(player);
60 | }
61 |
62 | // Temporarily stops the player from moving
63 | void FreezePlayer()
64 | {
65 | System.Threading.Thread.Sleep(1000);
66 | player = states[0];
67 | }
68 |
69 | // Reads directional input from the Console and moves the player
70 | void Move()
71 | {
72 | int lastX = playerX;
73 | int lastY = playerY;
74 |
75 | switch (Console.ReadKey(true).Key)
76 | {
77 | case ConsoleKey.UpArrow:
78 | playerY--;
79 | break;
80 | case ConsoleKey.DownArrow:
81 | playerY++;
82 | break;
83 | case ConsoleKey.LeftArrow:
84 | playerX--;
85 | break;
86 | case ConsoleKey.RightArrow:
87 | playerX++;
88 | break;
89 | case ConsoleKey.Escape:
90 | shouldExit = true;
91 | break;
92 | }
93 |
94 | // Clear the characters at the previous position
95 | Console.SetCursorPosition(lastX, lastY);
96 | for (int i = 0; i < player.Length; i++)
97 | {
98 | Console.Write(" ");
99 | }
100 |
101 | // Keep player position within the bounds of the Terminal window
102 | playerX = (playerX < 0) ? 0 : (playerX >= width ? width : playerX);
103 | playerY = (playerY < 0) ? 0 : (playerY >= height ? height : playerY);
104 |
105 | // Draw the player at the new location
106 | Console.SetCursorPosition(playerX, playerY);
107 | Console.Write(player);
108 | }
109 |
110 | // Clears the console, displays the food and player
111 | void InitializeGame()
112 | {
113 | Console.Clear();
114 | ShowFood();
115 | Console.SetCursorPosition(0, 0);
116 | Console.Write(player);
117 | }
--------------------------------------------------------------------------------
/2-csharp/lesson-5-projects/challenge-project/Starter/Starter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-6-projects/challenge-project/Final/Final.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-6-projects/challenge-project/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Microsoft Learning
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/2-csharp/lesson-6-projects/challenge-project/README.md:
--------------------------------------------------------------------------------
1 | # Challenge-project-debugging-CSharp
2 | Starter and Solution code for the Challenge project: "Debug a C# console application using Visual Studio Code" from the Microsoft Learn collection "Getting started with C#"
3 |
--------------------------------------------------------------------------------
/2-csharp/lesson-6-projects/challenge-project/Starter/Starter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-6-projects/guided-project/Final/Final.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/2-csharp/lesson-6-projects/guided-project/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Microsoft Learning
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/2-csharp/lesson-6-projects/guided-project/README.md:
--------------------------------------------------------------------------------
1 | # Guided-project-debugging-CSharp
2 | Starter and Solution code for the Guided project: "Debug and handle exceptions in a C# console application using Visual Studio Code" from the Microsoft Learn collection "Getting started with C#"
3 |
--------------------------------------------------------------------------------
/2-csharp/lesson-6-projects/guided-project/Starter/Starter.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net8.0
6 | enable
7 | enable
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/3-razor-pages/0-start/RazorPagesPizza/RazorPagesPizza.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.7.33808.371
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorPagesPizza", "RazorPagesPizza\RazorPagesPizza.csproj", "{ADA085D1-1380-4955-A58D-FD688EC5B4B9}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {ADA085D1-1380-4955-A58D-FD688EC5B4B9}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {7052E9F1-F97B-4A22-AEA8-66D01D921E93}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/3-razor-pages/0-start/RazorPagesPizza/RazorPagesPizza/Pages/Error.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model ErrorModel
3 | @{
4 | ViewData["Title"] = "Error";
5 | }
6 |
7 |
Error.
8 |
An error occurred while processing your request.
9 |
10 | @if (Model.ShowRequestId)
11 | {
12 |
13 | Request ID:@Model.RequestId
14 |
15 | }
16 |
17 |
Development Mode
18 |
19 | Swapping to the Development environment displays detailed information about the error that occurred.
20 |
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
19 | Swapping to the Development environment displays detailed information about the error that occurred.
20 |
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | The Development environment shouldn't be enabled for deployed applications.
22 | It can result in displaying sensitive information from exceptions to end users.
23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
24 | and restarting the app.
25 |
18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | The Development environment shouldn't be enabled for deployed applications.
22 | It can result in displaying sensitive information from exceptions to end users.
23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
24 | and restarting the app.
25 |
26 |
27 | @code{
28 | [CascadingParameter]
29 | private HttpContext? HttpContext { get; set; }
30 |
31 | private string? RequestId { get; set; }
32 | private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
33 |
34 | protected override void OnInitialized() =>
35 | RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
36 | }
37 |
--------------------------------------------------------------------------------
/5-blazor/1-complete/ConnectFour/Components/Pages/Home.razor:
--------------------------------------------------------------------------------
1 | @page "/"
2 |
3 | Connect Four
4 |
5 |
6 |
--------------------------------------------------------------------------------
/5-blazor/1-complete/ConnectFour/Components/Routes.razor:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/5-blazor/1-complete/ConnectFour/Components/_Imports.razor:
--------------------------------------------------------------------------------
1 | @using System.Net.Http
2 | @using System.Net.Http.Json
3 | @using Microsoft.AspNetCore.Components.Forms
4 | @using Microsoft.AspNetCore.Components.Routing
5 | @using Microsoft.AspNetCore.Components.Web
6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode
7 | @using Microsoft.AspNetCore.Components.Web.Virtualization
8 | @using Microsoft.JSInterop
9 | @using ConnectFour
10 | @using ConnectFour.Components
11 |
--------------------------------------------------------------------------------
/5-blazor/1-complete/ConnectFour/ConnectFour.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/5-blazor/1-complete/ConnectFour/GameState.cs:
--------------------------------------------------------------------------------
1 | namespace ConnectFour;
2 |
3 | public class GameState
4 | {
5 |
6 | static GameState()
7 | {
8 | CalculateWinningPlaces();
9 | }
10 |
11 | ///
12 | /// Indicate whether a player has won, the game is a tie, or game in ongoing
13 | ///
14 | public enum WinState
15 | {
16 | No_Winner = 0,
17 | Player1_Wins = 1,
18 | Player2_Wins = 2,
19 | Tie = 3
20 | }
21 |
22 | ///
23 | /// The player whose turn it is. By default, player 1 starts first
24 | ///
25 | public int PlayerTurn => TheBoard.Count(x => x != 0) % 2 + 1;
26 |
27 | ///
28 | /// Number of turns completed and pieces played so far in the game
29 | ///
30 | public int CurrentTurn { get { return TheBoard.Count(x => x != 0); } }
31 |
32 | public static readonly List WinningPlaces = new();
33 |
34 | public static void CalculateWinningPlaces()
35 | {
36 |
37 | // Horizontal rows
38 | for (byte row=0;row<6;row++){
39 |
40 | byte rowCol1 = (byte)(row * 7);
41 | byte rowColEnd = (byte)((row + 1) * 7 - 1);
42 | byte checkCol = rowCol1;
43 | while (checkCol <= rowColEnd-3)
44 | {
45 | WinningPlaces.Add(new int[] {
46 | checkCol,
47 | (byte)(checkCol + 1),
48 | (byte)(checkCol + 2),
49 | (byte)(checkCol + 3)
50 | });
51 | checkCol++;
52 | }
53 |
54 | }
55 |
56 | // Vertical Columns
57 | for (byte col = 0; col < 7; col++)
58 | {
59 |
60 | byte colRow1 = col;
61 | byte colRowEnd = (byte)(35+col);
62 | byte checkRow = colRow1;
63 | while (checkRow <= 14+col)
64 | {
65 | WinningPlaces.Add(new int[] {
66 | checkRow,
67 | (byte)(checkRow + 7),
68 | (byte)(checkRow + 14),
69 | (byte)(checkRow + 21)
70 | });
71 | checkRow+=7;
72 | }
73 |
74 | }
75 |
76 | // forward slash diagonal "/"
77 | for (byte col = 0; col < 4; col++)
78 | {
79 |
80 | // starting column must be 0-3
81 | byte colRow1 = (byte)(21 + col);
82 | byte colRowEnd = (byte)(35 + col);
83 | byte checkPos = colRow1;
84 | while (checkPos <= colRowEnd)
85 | {
86 | WinningPlaces.Add(new int[] {
87 | checkPos,
88 | (byte)(checkPos - 6),
89 | (byte)(checkPos - 12),
90 | (byte)(checkPos - 18)
91 | });
92 | checkPos += 7;
93 | }
94 |
95 | }
96 |
97 | // back slash diaganol "\"
98 | for (byte col = 0; col < 4; col++)
99 | {
100 |
101 | // starting column must be 0-3
102 | byte colRow1 = (byte)(0 + col);
103 | byte colRowEnd = (byte)(14 + col);
104 | byte checkPos = colRow1;
105 | while (checkPos <= colRowEnd)
106 | {
107 | WinningPlaces.Add(new int[] {
108 | checkPos,
109 | (byte)(checkPos + 8),
110 | (byte)(checkPos + 16),
111 | (byte)(checkPos + 24)
112 | });
113 | checkPos += 7;
114 | }
115 |
116 | }
117 |
118 |
119 | }
120 |
121 | ///
122 | /// Check the state of the board for a winning scenario
123 | ///
124 | /// 0 - no winner, 1 - player 1 wins, 2 - player 2 wins, 3 - draw
125 | public WinState CheckForWin()
126 | {
127 |
128 | // Exit immediately if less than 7 pieces are played
129 | if (TheBoard.Count(x => x != 0) < 7) return WinState.No_Winner;
130 |
131 | foreach (var scenario in WinningPlaces)
132 | {
133 |
134 | if (TheBoard[scenario[0]] == 0) continue;
135 |
136 | if (TheBoard[scenario[0]] ==
137 | TheBoard[scenario[1]] &&
138 | TheBoard[scenario[1]] ==
139 | TheBoard[scenario[2]] &&
140 | TheBoard[scenario[2]] ==
141 | TheBoard[scenario[3]]) return (WinState)TheBoard[scenario[0]];
142 |
143 | }
144 |
145 | if (TheBoard.Count(x => x != 0) == 42) return WinState.Tie;
146 |
147 | return WinState.No_Winner;
148 |
149 | }
150 |
151 | ///
152 | /// Takes the current turn and places a piece in the 0-indexed column requested
153 | ///
154 | /// 0-indexed column to place the piece into
155 | /// The final array index where the piece resides
156 | public byte PlayPiece(int column)
157 | {
158 |
159 | // Check for a current win
160 | if (CheckForWin() != 0) throw new ArgumentException("Game is over");
161 |
162 | // Check the column
163 | if (TheBoard[column] != 0) throw new ArgumentException("Column is full");
164 |
165 | // Drop the piece in
166 | var landingSpot = column;
167 | for (var i=column;i<42;i+=7)
168 | {
169 | if (TheBoard[landingSpot + 7] != 0) break;
170 | landingSpot = i;
171 | }
172 |
173 | TheBoard[landingSpot] = PlayerTurn;
174 |
175 | return ConvertLandingSpotToRow(landingSpot);
176 |
177 | }
178 |
179 | public List TheBoard { get; private set; } = new List(new int[42]);
180 |
181 | public void ResetBoard() {
182 | TheBoard = new List(new int[42]);
183 | }
184 |
185 | private byte ConvertLandingSpotToRow(int landingSpot)
186 | {
187 |
188 | return (byte)(Math.Floor(landingSpot / (decimal)7) + 1);
189 |
190 | }
191 |
192 | }
--------------------------------------------------------------------------------
/5-blazor/1-complete/ConnectFour/Program.cs:
--------------------------------------------------------------------------------
1 | using ConnectFour;
2 | using ConnectFour.Components;
3 |
4 | var builder = WebApplication.CreateBuilder(args);
5 |
6 | // Add services to the container.
7 | builder.Services.AddRazorComponents()
8 | .AddInteractiveServerComponents();
9 | builder.Services.AddSingleton();
10 |
11 | var app = builder.Build();
12 |
13 | // Configure the HTTP request pipeline.
14 | if (!app.Environment.IsDevelopment())
15 | {
16 | app.UseExceptionHandler("/Error", createScopeForErrors: true);
17 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
18 | app.UseHsts();
19 | }
20 |
21 | app.UseHttpsRedirection();
22 |
23 | app.UseStaticFiles();
24 | app.UseAntiforgery();
25 |
26 | app.MapRazorComponents()
27 | .AddInteractiveServerRenderMode();
28 |
29 | app.Run();
30 |
--------------------------------------------------------------------------------
/5-blazor/1-complete/ConnectFour/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:16315",
7 | "sslPort": 44390
8 | }
9 | },
10 | "profiles": {
11 | "http": {
12 | "commandName": "Project",
13 | "dotnetRunMessages": true,
14 | "launchBrowser": true,
15 | "applicationUrl": "http://localhost:5007",
16 | "environmentVariables": {
17 | "ASPNETCORE_ENVIRONMENT": "Development"
18 | }
19 | },
20 | "https": {
21 | "commandName": "Project",
22 | "dotnetRunMessages": true,
23 | "launchBrowser": true,
24 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
25 | "applicationUrl": "https://localhost:7000;http://localhost:5007",
26 | "environmentVariables": {
27 | "ASPNETCORE_ENVIRONMENT": "Development"
28 | }
29 | },
30 | "IIS Express": {
31 | "commandName": "IISExpress",
32 | "launchBrowser": true,
33 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
34 | "environmentVariables": {
35 | "ASPNETCORE_ENVIRONMENT": "Development"
36 | }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/5-blazor/1-complete/ConnectFour/wwwroot/app.css:
--------------------------------------------------------------------------------
1 | html, body {
2 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
3 | }
4 |
5 | a, .btn-link {
6 | color: #006bb7;
7 | }
8 |
9 | .btn-primary {
10 | color: #fff;
11 | background-color: #1b6ec2;
12 | border-color: #1861ac;
13 | }
14 |
15 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
16 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
17 | }
18 |
19 | .content {
20 | padding-top: 1.1rem;
21 | }
22 |
23 | h1:focus {
24 | outline: none;
25 | }
26 |
27 | .valid.modified:not([type=checkbox]) {
28 | outline: 1px solid #26b050;
29 | }
30 |
31 | .invalid {
32 | outline: 1px solid #e50000;
33 | }
34 |
35 | .validation-message {
36 | color: #e50000;
37 | }
38 |
39 | .blazor-error-boundary {
40 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
41 | padding: 1rem 1rem 1rem 3.7rem;
42 | color: white;
43 | }
44 |
45 | .blazor-error-boundary::after {
46 | content: "An error has occurred."
47 | }
48 |
49 | .darker-border-checkbox.form-check-input {
50 | border-color: #929292;
51 | }
52 |
--------------------------------------------------------------------------------
/5-blazor/1-complete/ConnectFour/wwwroot/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/5-blazor/1-complete/ConnectFour/wwwroot/favicon.png
--------------------------------------------------------------------------------
/5-blazor/img/1-NewTemplate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/5-blazor/img/1-NewTemplate.png
--------------------------------------------------------------------------------
/5-blazor/img/2-Board-Step1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/5-blazor/img/2-Board-Step1.png
--------------------------------------------------------------------------------
/5-blazor/img/2-Board-Step2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/5-blazor/img/2-Board-Step2.png
--------------------------------------------------------------------------------
/5-blazor/img/2-Board-Step3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/5-blazor/img/2-Board-Step3.png
--------------------------------------------------------------------------------
/5-blazor/img/2-board-drop.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/5-blazor/img/2-board-drop.gif
--------------------------------------------------------------------------------
/5-blazor/img/3-Board-ErrorHandler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/5-blazor/img/3-Board-ErrorHandler.png
--------------------------------------------------------------------------------
/5-blazor/img/3-Board-Step1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/5-blazor/img/3-Board-Step1.png
--------------------------------------------------------------------------------
/5-blazor/img/3-Board-Step2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/5-blazor/img/3-Board-Step2.png
--------------------------------------------------------------------------------
/5-blazor/img/4-Board.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/5-blazor/img/4-Board.png
--------------------------------------------------------------------------------
/6-publish/images/azure-customer-agreement.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/6-publish/images/azure-customer-agreement.png
--------------------------------------------------------------------------------
/6-publish/images/azure-start-free.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/6-publish/images/azure-start-free.png
--------------------------------------------------------------------------------
/6-publish/images/create-new-app-service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/6-publish/images/create-new-app-service.png
--------------------------------------------------------------------------------
/6-publish/images/hosting-plan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/6-publish/images/hosting-plan.png
--------------------------------------------------------------------------------
/6-publish/images/publish-new-app-service.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/6-publish/images/publish-new-app-service.png
--------------------------------------------------------------------------------
/6-publish/images/sign-in-azure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/6-publish/images/sign-in-azure.png
--------------------------------------------------------------------------------
/6-publish/images/solution-explorer-publish.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/6-publish/images/solution-explorer-publish.png
--------------------------------------------------------------------------------
/6-publish/images/specific-target.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/6-publish/images/specific-target.png
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | This project has adopted the code of conduct defined by the Contributor Covenant
4 | to clarify expected behavior in our community.
5 | For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) .NET Foundation. All rights reserved.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
22 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Security
4 |
5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6 |
7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
8 |
9 | ## Reporting Security Issues
10 |
11 | **Please do not report security vulnerabilities through public GitHub issues.**
12 |
13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14 |
15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16 |
17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18 |
19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20 |
21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22 | * Full paths of source file(s) related to the manifestation of the issue
23 | * The location of the affected source code (tag/branch/commit or direct URL)
24 | * Any special configuration required to reproduce the issue
25 | * Step-by-step instructions to reproduce the issue
26 | * Proof-of-concept or exploit code (if possible)
27 | * Impact of the issue, including how an attacker might exploit the issue
28 |
29 | This information will help us triage your report more quickly.
30 |
31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32 |
33 | ## Preferred Languages
34 |
35 | We prefer all communications to be in English.
36 |
37 | ## Policy
38 |
39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
40 |
41 |
--------------------------------------------------------------------------------
/images/intro-thumbnail.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/images/intro-thumbnail.jpg
--------------------------------------------------------------------------------
/images/what-is-dotnet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dotnet/intro-to-dotnet-web-dev/8b4bf9bc410c4b41bbbe5285cd676da7828d1d00/images/what-is-dotnet.png
--------------------------------------------------------------------------------