Skip to content

Commit 4e90889

Browse files
committed
Update README.md with enhanced instructions and add images for better clarity on running and debugging the backend project
1 parent 694ab54 commit 4e90889

File tree

5 files changed

+30
-10
lines changed

5 files changed

+30
-10
lines changed

Using-GitHub-Copilot-with-CSharp/README.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,37 +82,57 @@ TODO: Add gif/jpg of flow
8282

8383
### 🗒️ Section 2: Code Completion
8484

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.
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). Start Debugging the selected project.
8686

87-
TODO: Add gig/jpg
87+
<div align="left">
88+
<img src="./images/003RunBackEndProject.png" alt="Run and Debug in the Panel" width="500" height="300">
89+
</div>
90+
91+
2. The BackEnd project for our Weather API will now be running in port 8080. If you used Copilot to Run and Debug, it will output the URL for you in the chat pane. Simply click the text and it will open a new tab with the published URL. Ensure that `/weatherforcast` is in the published URL.
92+
93+
<div align="left">
94+
<img src="./images/004rundebugURL.jpg" alt="Run and Debug Output" width="500" height="300">
95+
</div>
96+
97+
If the URL is not loading properly, check the format and use the below format for the final URL:
98+
99+
```bash
100+
https://< your url>.app.github.dev/weatherforecast
101+
```
88102

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
103+
**NOTE:** If you chose to run and debug the application from the run and debug panel, you will see the URL for the website in the _Ports_ tab in the editor:
104+
105+
<div align="left">
106+
<img src="./images/005ports.jpg" alt="port view in the editor" width="500" height="300">
107+
</div>
90108

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):
109+
3. 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):
92110

93111
```csharp
94112
// create a new internal record named WeatherForecastByCity that request the following parameters: City, Date, TemperatureC, Summary
95113
```
96114

97115
TODO: show output
98116

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:
117+
4. 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:
100118

101119
```csharp
102120
// Create a class for a Customer with Id, Name, and Email, and a method to validate email format
103121
```
104122

105-
4. Accept the suggestion and using the inline prompt window ask:
123+
5. Accept the suggestion and using the inline prompt window ask:
106124

107125
```csharp
108126
/improve IsValidEmail method using Regex
109127
```
110128

111-
5. You can further highlight the method and ask inline (or select `CTRL + Shift + I`) to open chat and ask Copilot 'Explain what IsValidEmail() does'
112-
113-
6. While Inline suggestions are great at autocompleting a section of code, we often need help with multiple edits. Copilot next edit suggestions will predict the location of the next edit and what that edit should be. In this task we will implement a simple endpoint for retrieving and creating customers.
129+
6. You can further highlight the method and ask inline (or select `CTRL + Shift + I`) to open chat and ask Copilot 'Explain what IsValidEmail() does'
114130

115-
TODO: NES
131+
7. While Inline suggestions are great at autocompleting a section of code, we often need help with multiple edits. Copilot next edit suggestions will predict the location of the next edit and what that edit should be. In this task we will implement a simple endpoint for retrieving and creating customers.
132+
TODO: More explanation
133+
<div align="left">
134+
<img src="./images/NextEdit.gif" alt="Output of /Explain" width="500" height="300">
135+
</div>
116136

117137
In the above exercises we achieved the following:
118138
- ✅ Generated suggestions from code comments
130 KB
Loading
158 KB
Loading
2.45 MB
Loading

0 commit comments

Comments
 (0)