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
Refactor README.md to improve clarity on using GitHub Copilot's Agent Mode, including new API endpoint generation instructions and customization context.
***Important:** Youmustplacethecodeafterthe '.WithOpenApi();' line, this starts on line 36. Also remember to press TAB in each new suggested line until the whole endpoint is defined.*
// Create a new endpoint named /WeatherForecastByCity/{city}, that accepts a city name in the urls as a paremeter and generates a random forecast for that city
192
-
```
193
-
In the following example, we added some extra blank lines after the previous endpoint and then GitHub Copilot generated the new endpoint. Once the Endpoint core code was generated, GitHub Copilot also suggested code for the name of the endpoint (line 49) and the OpenAPI specification (line 50). Remember to accept each one of these suggestions by pressing [TAB].
194
-
195
-

196
-
197
-
***Important**: This prompt generates several lines of C# code. It's strongly advised to check and review the generated code to verify that it works in the desired way.*
198
-
199
-
The generated code should look similar to this one:
200
-
201
-
```csharp
202
-
// Create a new endpoint named /WeatherForecastByCity/{city}, that accepts a city name in the urls as a paremeter and generates a random forecast for that city
Finally, verify the new endpoint is working by starting the project from the Run and Debug panel.
223
-
Select Run and Debug, and then select the BackEnd project.
224
-
225
-

226
-
227
-
Now press Run and the project should build and run. Once the project is running, we can test the original Url using your Codespace url and the original endpoint:
🚀 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 also write documentation, test your applications and more.
0 commit comments