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: Using-GitHub-Copilot-with-CSharp/README.md
+30-10Lines changed: 30 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,37 +82,57 @@ TODO: Add gif/jpg of flow
82
82
83
83
### 🗒️ Section 2: Code Completion
84
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.
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.
86
86
87
-
TODO: Add gig/jpg
87
+
<divalign="left">
88
+
<imgsrc="./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
+
<divalign="left">
94
+
<imgsrc="./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
+
```
88
102
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
+
<divalign="left">
106
+
<imgsrc="./images/005ports.jpg"alt="port view in the editor"width="500"height="300">
107
+
</div>
90
108
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):
92
110
93
111
```csharp
94
112
// create a new internal record named WeatherForecastByCity that request the following parameters: City, Date, TemperatureC, Summary
95
113
```
96
114
97
115
TODO: show output
98
116
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:
100
118
101
119
```csharp
102
120
// Create a class for a Customer with Id, Name, and Email, and a method to validate email format
103
121
```
104
122
105
-
4. Accept the suggestion and using the inline prompt window ask:
123
+
5. Accept the suggestion and using the inline prompt window ask:
0 commit comments