You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add settings for cSpell and update README.md for clarity and structure
- Introduced a new settings.json file for cSpell configuration.
- Revised section titles and content in README.md to enhance clarity.
- Added images for better visual guidance in the README.
Copy file name to clipboardExpand all lines: Using-GitHub-Copilot-with-CSharp/README.md
+31-21Lines changed: 31 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ The "**GitHub Codespaces ♥️ .NET 8**" repository builds a Weather API using
43
43
We will review the steps to update the Weather BackEnd App by adding a new endpoint that requests a specific location and returns the weather forecast for that location.
44
44
45
45
46
-
### 🗒️ Section 1: Code Completion
46
+
### 🗒️ Section 1: Exploring Your Project
47
47
48
48
🎯**Learning Goals**
49
49
- Use inline code completion to scaffold new classes and methods
@@ -54,64 +54,73 @@ Once your Codespace launches, you'll have a fully functional development environ
54
54
55
55
To get started:
56
56
57
-
1. Click the Copilot Chat icon in the top-right corner of the Codespace window
2. Instead of manually exploring the BackEnd and Front folders, try asking Copilot for an overview. In the chat pane, type '/' to view available slash commands — these offer quick, structured ways to interact with Copilot.
61
-
Type '/help' to see all commands, or check out the {GitHub Copilot Chat cheat sheet for a list of slash commands](https://docs.github.com/copilot/reference/github-copilot-chat-cheat-sheet#slash-commands) available.
62
-
For example, you can use:
63
-
-`/doc` to add a documentation comment
64
-
-`/explain` to explain the code
65
-
-`/fix` to propose a fix for the problems in the selected code
66
-
-`/generate` to generate code to answer your question
67
64
68
-
3. In lieu of using natural language, type in '/explain' into the chat pane. The output from GitHub Copilot will go into details of how the project is structured, including further information of the Frontend and Backend details.
65
+
Type `/help` to see all commands, or check out the [GitHub Copilot Chat cheat sheet](https://docs.github.com/copilot/reference/github-copilot-chat-cheat-sheet#slash-commands) for a list of available slash commands.
66
+
67
+
For example, you can use:
68
+
-`/doc` to add a documentation comment
69
+
-`/explain` to explain the code
70
+
-`/fix` to propose a fix for the problems in the selected code
71
+
-`/generate` to generate code to answer your question
72
+
73
+
3. In lieu of using natural language, type `/explain` into the chat pane. The output from GitHub Copilot will go into details of how the project is structured, including further information of the Frontend and Backend details.
69
74
70
-
TODO: Add gif/jpg of output
75
+
<divalign="left">
76
+
<imgsrc="./images/002explainoutput.gif"alt="Output of /Explain"width="500"height="300">
77
+
</div>
71
78
72
79
4. As a visual learner, you can ask GitHub Copilot to create a diagram of the workflow of the application. This could be saved into a README for further documentation.
73
80
74
81
TODO: Add gif/jpg of flow
75
82
76
-
5. Ask GitHub Copilot in the chat pane to "run and debug" the backend project (you can also do this from the 'run and debug' panel in the editor). Copilot will debug the selected project, showing the running port 8080. Copilot will give you the url to the website (selecting the 'ports' tab in the terminal will also output the url). When selecting the published url ensure that the '/weatherforecast' endpoint is named. This should produce a successfully test displaying the running application.
83
+
### 🗒️ Section 2: Code Completion
84
+
85
+
1. Ask GitHub Copilot in the chat pane to "run and debug" the backend project (you can also do this from the 'run and debug' panel in the editor). Copilot will debug the selected project, showing the running port 8080. Copilot will give you the url to the website (selecting the 'ports' tab in the terminal will also output the url). When selecting the published url ensure that the '/weatherforecast' endpoint is named. This should produce a successfully test displaying the running application.
77
86
78
87
TODO: Add gig/jpg
79
88
80
89
In this section you learned how to use both natural language or slash commands to quickly understand the codebase without digging through folders. In the next set of exercises we're going to use Copilot to create a new class using code completion
81
90
82
-
6. In order to generate a new record that includes the name of the city, navigates to the following path `SampleApp\BackEnd\Program.cs` and open `Program.cs`. Navigate to the end of the file and type in (or copy):
91
+
2. In order to generate a new record that includes the name of the city, navigates to the following path `SampleApp\BackEnd\Program.cs` and open `Program.cs`. Navigate to the end of the file and type in (or copy):
83
92
84
93
```csharp
85
94
// create a new internal record named WeatherForecastByCity that request the following parameters: City, Date, TemperatureC, Summary
86
95
```
87
96
88
97
TODO: show output
89
98
90
-
7. We can create a new C# class by creating a new file under the 'BackEnd' folder: '/BackEnd/customer.cs'. Press `CTRL + I` to open the inline chat and type in:
99
+
3. We can create a new C# class by creating a new file under the 'BackEnd' folder: '/BackEnd/customer.cs'. Press `CTRL + I` to open the inline chat and type in:
91
100
92
101
```csharp
93
102
// Create a class for a Customer with Id, Name, and Email, and a method to validate email format
94
103
```
95
104
96
-
8. Accept the suggestion and using the inline prompt window ask:
105
+
4. Accept the suggestion and using the inline prompt window ask:
0 commit comments