From 4df2997566ebf03893e4b924a71f252b82312f05 Mon Sep 17 00:00:00 2001 From: katiesavage Date: Fri, 6 May 2022 16:41:26 -0700 Subject: [PATCH 1/5] add email 1 folder --- 1-welcome/how-to-install-vs.md | 5 +++++ README.md | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 1-welcome/how-to-install-vs.md diff --git a/1-welcome/how-to-install-vs.md b/1-welcome/how-to-install-vs.md new file mode 100644 index 0000000..def2bf5 --- /dev/null +++ b/1-welcome/how-to-install-vs.md @@ -0,0 +1,5 @@ +# Install Visual Studio + +1. Go to the [Develop .NET applications page](https://visualstudio.microsoft.com/vs/features/net-development/) of the Visual Studio website +1. Find the "Download Visual Studio with .NET" dropdown and select "Community 2022" +1. diff --git a/README.md b/README.md index 6d70fa2..7f3fbbf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ ## Intro to Web Development with .NET -// coming soon +Welcome to the Intro to Web Development with .NET GitHub repository! + +Here, you'll find all of the projects and challenges associated with each email in the email series. Each email will have a dedicated folder containing all the relevant information. ## .NET Foundation From 871ebef59f45f95161194ba688b1d12d675ccadd Mon Sep 17 00:00:00 2001 From: katiesavage Date: Fri, 6 May 2022 17:21:10 -0700 Subject: [PATCH 2/5] Added VS install instructions --- 1-welcome/how-to-install-vs.md | 24 +++++++++++++++++++++++- README.md | 4 +++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/1-welcome/how-to-install-vs.md b/1-welcome/how-to-install-vs.md index def2bf5..fdc70a1 100644 --- a/1-welcome/how-to-install-vs.md +++ b/1-welcome/how-to-install-vs.md @@ -1,5 +1,27 @@ # Install Visual Studio +## If you're on Windows 1. Go to the [Develop .NET applications page](https://visualstudio.microsoft.com/vs/features/net-development/) of the Visual Studio website 1. Find the "Download Visual Studio with .NET" dropdown and select "Community 2022" -1. +1. Run the exe and let Visual Studio download +1. Wait for everything to install +1. Sign in to Visual Studio +1. Done ✔️ + +## If you're on Mac +1. Go to the [Build Web Apps using .NET Core page](https://visualstudio.microsoft.com/vs/mac/net/) of the Visual Studio website +1. Select the VisualStudioforMacInstaller.dmg to mount the installer, then run it by double-clicking the arrow logo +2. Select **Open** +1. An alert will appear asking you to acknowledge the privacy and license terms. Follow the links to read them, then press **Continue** if you agree +1. The list of available workloads is displayed. Select the .NET Core component. +1. Press **Install** +1. Sign in and choose your keyboard preferences +1. Done ✔️ + +## Want more help? +If you want more detailed installation instructions, check out the Microsof Documentation. +* If you're on Windows, go to [Install Visual Studio](https://docs.microsoft.com/visualstudio/install/install-visual-studio?view=vs-2022) +* If you're on Mac, go to [Install Visual Studio for Mac](https://docs.microsoft.com/visualstudio/mac/installation?view=vsmac-2019) + +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! 🤗 + diff --git a/README.md b/README.md index 7f3fbbf..f3b8e2c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ Welcome to the Intro to Web Development with .NET GitHub repository! -Here, you'll find all of the projects and challenges associated with each email in the email series. Each email will have a dedicated folder containing all the relevant information. +Here, you'll find all of the projects and challenges associated with each email in the email series. Each email will have a dedicated folder containing all the relevant information for that week. + +We are currently in the planning stages of this series! ## .NET Foundation From 777809e8ef7da1f74383ab5183e1a8b63ef40fd8 Mon Sep 17 00:00:00 2001 From: katiesavage Date: Fri, 6 May 2022 17:36:36 -0700 Subject: [PATCH 3/5] added README to 1-welcome --- 1-welcome/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 1-welcome/README.md diff --git a/1-welcome/README.md b/1-welcome/README.md new file mode 100644 index 0000000..03fad50 --- /dev/null +++ b/1-welcome/README.md @@ -0,0 +1,3 @@ +# Welcome to the Intro to Web Dev with .NET series + +Make sure you have [Visual Studio](https://visualstudio.microsoft.com/vs/features/net-development/) or [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/net/), as well as the [.NET 6 SDK](https://dotnet.microsoft.com/download). \ No newline at end of file From 8e56afa896acb633e11be899c2b541fa2eb3195d Mon Sep 17 00:00:00 2001 From: Jon Galloway Date: Tue, 10 May 2022 11:13:02 -0700 Subject: [PATCH 4/5] Markdown formatting fixes --- 2-csharp/README.md | 88 +++++++++++++++++++++++++++++++++------------- 1 file changed, 64 insertions(+), 24 deletions(-) diff --git a/2-csharp/README.md b/2-csharp/README.md index f5ed90a..2b8f08d 100644 --- a/2-csharp/README.md +++ b/2-csharp/README.md @@ -3,6 +3,7 @@ In this C# Crash Course, we'll go over the basics of C# so that you'll be ready to build out exciting web apps! We'll start by going through the key attributes of C#, syntax basics, and introduce you to OOP. In each section, we'll link you to some quick in-browser C# challenges so you can apply these concepts. ## Topics you'll learn + * Language attributes * Syntax basics * Object Oriented Programming @@ -10,22 +11,29 @@ In this C# Crash Course, we'll go over the basics of C# so that you'll be ready --- # Language attributes -C# is a strongly typed, compiled, object oriented language. Let's break this down. -## Strongly typed - In a **strongly typed** language, every variable has a defined type. Some of these types include: - * String, "Hello world!" - * Char, 'a' - * int, 3 - * decimal, 1.5 - * bool, True -## Compiler +C# is a strongly typed, compiled, object oriented language. Let's break this down. + +## Strongly typed + + In a **strongly typed** language, every variable has a defined type. Some of these types include: + +* String, "Hello world!" +* Char, 'a' +* int, 3 +* decimal, 1.5 +* bool, True + +## Compiler + A **compiler** converts the code you write into a format that your computer can understand. After you write C# and build it, the C# compiler (called Roslyn) will analyze your code to check for any errors. --- # The basics + ## 🌍 Hello World + Here's a piece of code that will print "Hello world!" to the console. ```csharp @@ -35,16 +43,20 @@ Console.WriteLine("Hello world!"); ``` ## Keywords + With C#, you use keywords like `using` and `Console`. **Keywords** are predefined, reserved identifiers that have special meanings to the compiler. ## Accessing methods + The `. (DOT)` in `Console.WriteLine` allows us to access methods and properties. In this example, `Console` is a type that represents the console window. `WriteLine` is a method of the Console type that prints a line of text to that text console. ## Parameters -In this example, we use parentheses pass a string as a parameter to `Console.WriteLine`. -## 🚨 Challenge 1 +In this example, we use parentheses pass a string as a parameter to `Console.WriteLine`. + +## 🚨 Challenge 1 + Time for your first challenge! | # | Challenge | Solution | Duration | What you will learn | More information | @@ -52,40 +64,55 @@ Time for your first challenge! 1 | [Hello World Challenge](https://docs.microsoft.com/learn/modules/csharp-write-first/2-exercise-hello-world/?ns-enrollment-type=learningpath&ns-enrollment-id=learn.languages.csharp-first-steps)| N/A | 3 min | case sensitive, strings, comments | [Intro to C# Tutorial](https://docs.microsoft.com/dotnet/csharp/tour-of-csharp/tutorials/hello-world?WT.mc_id=csharpnotebook-35129-website), [C# documentation](https://docs.microsoft.com/dotnet/csharp/) | ## Variables -In C#, **variables** allow you to temporarily store a value in memory. In C#, you must declare a variable before using it. + +In C#, **variables** allow you to temporarily store a value in memory. In C#, you must declare a variable before using it. + ```csharp var cSharp = "really cool"; ``` + In this example, we created a string called `cSharp`. You can use the var keyword to declare local variables without explicitly giving them a type. Variable names can contain alphanumeric characters and underscores, but no special characters. They also cannot be keywords. ## 🚨 Challenge 2 + | # | Challenge | Solution | Duration | What you will learn | More information | |-| ------------------------------- | ------------------------------- | ----------- | -------------------------------------- | - | 2 | [Variables Challenge](https://docs.microsoft.com/learn/modules/csharp-literals-variables/6-challenge )|[Solution](https://docs.microsoft.com/learn/modules/csharp-literals-variables/7-solution)| 5 min | variables, data types, strings, ints, decimals | [String formatting tutorial](https://docs.microsoft.com/learn/modules/csharp-basic-formatting/), [C# documentation](https://docs.microsoft.com/dotnet/csharp/) | # Syntax cheat sheet + ## Semicolons + Every statement is ended by a semicolon + ```csharp Console.WriteLine("there is a ';' at the end of this statement"); ``` + ## Comments + You can make comments by using 2 slashes + ```csharp // this is a comment is C# ``` + ## Case sensitive + C# is case sensitive! For example, a variable "cat" is completely different from a variable "CAT". - ```csharp - var cat = "meow"; - ``` - ```csharp - var CAT = "rawr"; - ``` + +```csharp +var cat = "meow"; +``` + +```csharp +var CAT = "rawr"; +``` ## Arithmetic Operators + These are probably familiar to you! | symbol | what it does | | --- | ------ | @@ -98,26 +125,30 @@ Variable names can contain alphanumeric characters and underscores, but no speci | -- | decrement | ## 🚨 Challenge 3 + | # | Challenge | Solution | Duration | What you will learn | More information | |-| ------------------------------- | ------------------------------- | ----------- | -------------------------------------- | - | 3 | [Operating on numbers challenge](https://docs.microsoft.com/learn/modules/csharp-basic-operations/5-challenge)|[Solution](https://docs.microsoft.com/learn/modules/csharp-basic-operations/6-solution)| 2 min | ints, decimals | [Number operations tutorial](https://docs.microsoft.com/learn/modules/csharp-basic-operations/), [C# documentation](https://docs.microsoft.com/dotnet/csharp/) | ## Decision logic + In C#, you can build applications that employ decision-making logic so that your application performs different instructions based on a set of conditions. One way we do this is with an `if` statement. `if` statements are made up of three parts: + * The if keyword * A Boolean expression between parenthesis () * A code block defined by curly braces { } If there are multiple condition, you can utilize the `else if` and `else` statements. Basically, if the `if` statement fails, these other statements allow you to test against other conditions. -You can imagine this in the context of a rock⛰️-paper📃-scissors✂️ game. Imagine you chose rock⛰️. +You can imagine this in the context of a rock⛰️-paper📃-scissors✂️ game. Imagine you chose rock⛰️. + * `if` your opponent chooses scissors✂️, then you will win * `else if` your opponent also chooses rock⛰️, then you will tie * `else` your opponent chooses paper📃, then you will lose Each possible decision your opponent could make leads to a different outcome. - ## Boolean expressions + Booleans are expressions that return either `true` or `false`. They are often used to compare two or more things. | symbol | what it does | | --- | ---------- | @@ -129,18 +160,21 @@ Each possible decision your opponent could make leads to a different outcome. | != | not equal | ## 🚨 Challenge 4 + | # | Challenge | Solution | Duration | What you will learn | More information | |-| ------------------------------- | ------------------------------- | ----------- | -------------------------------------- | - | 4 | [Decision logic challenge](https://docs.microsoft.com/learn/modules/csharp-if-elseif-else/4-challenge)|[Solution](https://docs.microsoft.com/learn/modules/csharp-if-elseif-else/5-solution)| 2 min | if, else if, else, booleans | [Boolean expressions tutorial](https://docs.microsoft.com/learn/modules/csharp-evaluate-boolean-expressions/1-introduction), [C# documentation](https://docs.microsoft.com/dotnet/csharp/) | - + --- # Object Oriented Programming + C# is an object-oriented language. Objects are defined by **Classes**. In other words, an **Object** is an instance of a class. One way to think about this is that a class is like the blue prints for a house. The actual house that is built is an objects because it is an instance of this blue print. ## Properties and methods + Objects inherently have attributes. In C# we call these **properties**. The attributes of a house may be the number of doors, what color the house is painted, etc. We can also define **methods** which describe what an object can do. For example, you can sell your house. @@ -152,6 +186,7 @@ The Properties of a house could be the number of doors it has or the color it's A Method of our class is that we can sell our house 💸 Let's look at an example House class: + ```csharp // The namespace declaration provides a way to logically organize your classes namespace Classes; @@ -168,8 +203,10 @@ public class House } } ``` + ## Constructor -We can define a **constructor** to allow us to create new House objects. + +We can define a **constructor** to allow us to create new House objects. ```csharp public House(string address, int squareFeet) @@ -178,7 +215,9 @@ public House(string address, int squareFeet) this.Size = squareFeet; } ``` + When we create an object with `new` this constructor will be called. + ```csharp using Classes; @@ -187,18 +226,19 @@ var house = new House("123 Candy Cane Lane", 1500); ``` ## The .NET Class Library + C# also has built in classes and functionality within the .NET Class Library. The .NET Class Library is a collection of thousands of classes containing tens of thousands of methods. These methods are created by Microsoft and are available for use in your applications. For example, when we called `Console.WriteLine` earlier, we were calling a method from the `System.Console` class. For a more in-depth overview, you can read up on the .NET Class Library in the [.NET documentation](https://docs.microsoft.com/dotnet/standard/class-library-overview). ## 🚨 Challenge 5 + | # | Challenge | Solution | Duration | What you will learn | More information | |-| ------------------------------- | ------------------------------- | ----------- | -------------------------------------- | - | 5 | [.NET Class Library challenge](https://docs.microsoft.com/learn/modules/csharp-call-methods/5-challenge)|[Solution](https://docs.microsoft.com/learn/modules/csharp-call-methods/6-solution)| 2 min | ints, decimals | [.NET documentation](https://docs.microsoft.com/dotnet/standard/class-library-overview), [C# documentation](https://docs.microsoft.com/dotnet/csharp/) | - - # Bonus and more ways to connect Want more practice with C#? The .NET team has you covered. Here's a few learning resources: + * C# Video Series on [Microsoft Docs](https://docs.microsoft.com/shows/CSharp-101/?WT.mc_id=dotnet-35129-website) or [YouTube](https://www.youtube.com/watch?v=Z5JS36NlJiU) * Self Guided Tutorials on [Microsoft Learn](https://docs.microsoft.com/users/dotnet/collections/yz26f8y64n7k07) * [Learn to Code Page](https://dotnet.microsoft.com/learntocode) From 59807d628db886de4f8e019b2ed7bca502dc43ee Mon Sep 17 00:00:00 2001 From: Jon Galloway Date: Tue, 10 May 2022 14:06:41 -0700 Subject: [PATCH 5/5] Update how-to-install-vs.md --- 1-welcome/how-to-install-vs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-welcome/how-to-install-vs.md b/1-welcome/how-to-install-vs.md index fdc70a1..c6e402e 100644 --- a/1-welcome/how-to-install-vs.md +++ b/1-welcome/how-to-install-vs.md @@ -19,7 +19,7 @@ 1. Done ✔️ ## Want more help? -If you want more detailed installation instructions, check out the Microsof Documentation. +If you want more detailed installation instructions, check out the Microsoft Documentation. * If you're on Windows, go to [Install Visual Studio](https://docs.microsoft.com/visualstudio/install/install-visual-studio?view=vs-2022) * If you're on Mac, go to [Install Visual Studio for Mac](https://docs.microsoft.com/visualstudio/mac/installation?view=vsmac-2019)