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
Copy file name to clipboardExpand all lines: 04-Using-GitHub-Copilot-with-CSharp/README.md
+37-3
Original file line number
Diff line number
Diff line change
@@ -45,12 +45,27 @@ The "**GitHub Codespaces ♥️ .NET**" repository builds a Weather API using Mi
45
45
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.
46
46
47
47
48
-
### 🗒️ Step 1: Get familiarized with the "GitHub Codespaces ♥️ .NET" repository
48
+
### 🤔 Step 0: Get familiarized with the "GitHub Codespaces ♥️ .NET" repository
49
49
50
50
Once you open the repository in Codespaces, you will find a new browser window with a fully functional Codespace. Everything in this repository is contained within this one Codespace. In example, in the explorer panel, we can see the main code for the BackEnd and the FrontEnd project.
51
51
52
52

53
53
54
+
Before we run the project, let's use GitHub Copilot Chat to inquire about what the project is and the different components.
55
+
56
+
1. Open **GitHub Copilot Chat** from the main navigation bar.
57
+
1. Type in `What is this project doing, and what are the key components?` and hit **Send***
58
+
59
+
GitHub Copilot Chat will now look at the entire project and give us a summary of what the projects do, what technology they use, and any of the key components in them.
60
+
61
+

62
+
63
+
From here, you can click on files to navigate to them and you can ask follow up questions such as `What APIs are available?`.
64
+
65
+
66
+
### 🚀 Step 1: Run the projects
67
+
68
+
Now that we have context of what is in the project, let's run it and see it in action.
54
69
In order to run the BackEnd project, go to the "Run and Debug" panel, and select the "BackEnd" Project.
55
70
56
71

@@ -82,7 +97,6 @@ Pressing F10 we can debug step-by-step until line 32, where we can see the gener
82
97
83
98
You can stop debugging now.
84
99
85
-
86
100
Congratulations! Now you are ready to add more features into the app using GitHub Copilot.
87
101
88
102
### 🗒️ Step 2: Get familiarized with GitHub Copilot Slash Commands
@@ -95,7 +109,6 @@ Now let's use a slash command, in GitHub Copilot to understand a piece of code.
95
109
96
110

97
111
98
-
99
112
Based on your version of GitHub Copilot you will see either an inline response or an update in the Chat Panel. GitHub Copilot will create a detailed explanation of the selected code. A summarized version will be like this one:
100
113
101
114
```
@@ -218,6 +231,27 @@ Both tests running should be like these ones:
218
231
219
232
🚀 Congratulations, through the exercise, you haven't only used GitHub Copilot to generate code but also done it in an interactive and fun way! You can use GitHub Copilot to not only generate code, but write documentation, test your applications and more.
220
233
234
+
### ✨ Bonus: Add new capabilities with GitHub Copilot Edits
235
+
236
+
Let's use **Copilot Edits** to start an AI-powered code editing session and iterate quickly on code changes across multiple files by using natural language. Copilot Edits applies the edits directly in the editor, where you can review them in-place, with the full context of the surrounding code.
237
+
238
+
Let's add some new functionality so the user can enter the city they want to search for and call our new API.
239
+
240
+
1. Open the **Edits** mode window in GitHub Copilot Chat
2. Select the **+Add Files...** button from the Edits window and add **FetchData.razor** and **WeatherForecastClient.cs**.
244
+
3. Enter into the chat: `Update the user interface to ask the user the city they want the weather for, use the forecast client to call the new endpoint for the city, and update the table to display the city as well.
245
+
4. Select the **Send** button and now Edits will generate an iteration plan for the changes.
246
+
5. Review the edits and hit **Accept** in the edits window to accept all changes to files.
247
+
6. Run the application
248
+
249
+
> Note: If the application doesn't run or it doesn't call the new endpoint, validate the changes in the files changed and ensure the endpoint is being called correctly.
250
+
251
+

252
+
253
+
From here, you can continue to iterate and ask questions about styling or other pieces of functionality to add to the application.
0 commit comments