Skip to content

Commit 6d38edb

Browse files
authored
Update README.md
Fixed some potential misspellings/errors.
1 parent 2cb8564 commit 6d38edb

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

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

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Prepare to tackle a practical, hands-on project! You’ll work on modifying a C#
1111
</header>
1212

1313

14-
- **Who this is for**: Developers, DevOps Engineers, Software development managers, Testers.
14+
- **Who this is for**: Developers, DevOps Engineers, Software Development Managers, Testers.
1515
- **What you'll learn**: How to use GitHub Copilot to create code and add comments to your work.
1616
- **What you'll build**: C# files that will have code generated by Copilot AI for code and comment suggestions.
1717
- **Prerequisites**: GitHub Copilot is available to use for free, sign up for [GitHub Copilot](https://gh.io/copilot).
@@ -47,7 +47,7 @@ We will review the steps to update the Weather BackEnd App by adding a new endpo
4747

4848
### 🗒️ Step 1: Get familiarized with the "GitHub Codespaces ♥️ .NET 8" repository
4949

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.
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. For example, in the explorer panel, we can see the main code for the BackEnd and the FrontEnd projects.
5151

5252
![new Codespace with all the repository running](./005OpenRepoInCodeSpaces.png)
5353

@@ -74,7 +74,7 @@ Add a breakpoint in line 24 (press F9) and refresh the browser with the Url to t
7474

7575
![debug the running application.](./009DebugBackEndDemo.png)
7676

77-
Pressing F10 we can debug step-by-step until line 32, where we can see the generated values. The application should have been generated samples Weather values for the next 5 days. The variable `forecast` has an array containing these values.
77+
Pressing F10 we can debug step-by-step until line 32, where we can see the generated values. The application should have generated samples Weather values for the next 5 days. The variable `forecast` has an array containing these values.
7878

7979
![debug the running application.](./010DebugForecastValue.png)
8080

@@ -105,13 +105,13 @@ The selected C# code is part of an ASP.NET Core application using the minimal AP
105105
- `/fix` to propose a fix for the problems in the selected code
106106
- `/generate` to generate code to answer your question
107107

108-
Let's use the `/tests` command to generate tests to the code. Select lines 39-42, press `CTRL + I` to open the inline chat, and type `/tests` (or select the /tests slash command) to generate a new set of tests for this record.
108+
Let's use the `/tests` command to generate tests for the code. Select lines 39-42, press `CTRL + I` to open the inline chat, and type `/tests` (or select the /tests slash command) to generate a new set of tests for this record.
109109

110110
![Use slash command to generate tests for the selected piece of code](./012SlashCmdTests.gif)
111111

112112
At this point, GitHub Copilot will suggest a new class. You need to first press [Create] to create the new file.
113113

114-
A new class `ProgramTests.cs` was created and added to the project. This tests are using XUnit, however, you can ask to generate tests using another Unit Test library with a command like this one `/tests use MSTests for unit testing`.
114+
A new class `ProgramTests.cs` was created and added to the project. These tests are using XUnit, however, you can ask to generate tests using another Unit Test library with a command like this one `/tests use MSTests for unit testing`.
115115

116116
***Important:** We are not going to use the test file in this project. You must delete the generated test file to continue.*
117117

@@ -134,7 +134,7 @@ Navigate to the end of the file and ask Copilot to generate a new record that in
134134
// create a new internal record named WeatherForecastByCity that request the following parameters: City, Date, TemperatureC, Summary
135135
```
136136

137-
The generated code sould be similar to this one:
137+
The generated code should be similar to this one:
138138

139139
```csharp
140140
// create a new internal record named WeatherForecastByCity that request the following parameters: City, Date, TemperatureC, Summary
@@ -152,18 +152,18 @@ You can take a look at the prompt working in the next animation:
152152

153153
Now let's generate a new API endpoint similar to `/weatherforecast` that also includes the city name. The new API endpoint name will be **`/weatherforecastbycity`**.
154154

155-
***Important:** You must place the code after the '.WithOpenApi();' line, this starts in line 36. Also remember to press TAB in each new suggested line until the whole endpoint is defined.*
155+
***Important:** You must place the code after the '.WithOpenApi();' line, this starts on line 36. Also remember to press TAB in each new suggested line until the whole endpoint is defined.*
156156

157157
Next, generate a new endpoint with GitHub Copilot by adding the comment:
158158

159159
```csharp
160160
// 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
161161
```
162-
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 pressing [TAB].
162+
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].
163163

164164
![Copilot ghost suggestion for the new endpoint](./020GeneratedCode.gif)
165165

166-
***Important**: This prompt generates several lines of C# code. It's strongly adviced to check and review the generated code to verify that it works in the desired way.*
166+
***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.*
167167

168168
The generated code should look similar to this one:
169169

@@ -199,7 +199,7 @@ Now press Run and the project should build and run. Once the project is running,
199199
https://< your code space url >.app.github.dev/WeatherForecast
200200
```
201201

202-
And the new endpoint will be also ready to test. Here are some samples urls with different cities:
202+
And the new endpoint will also be ready to test. Here are some samples urls with different cities:
203203
```bash
204204
https://< your code space url >.app.github.dev/WeatherForecastByCity/Toronto
205205

@@ -213,7 +213,7 @@ Both tests running should be like these ones:
213213
![Open Run and Debug panel and select BackEnd project](./032TestAndDebugUsingUrls.png)
214214

215215

216-
🚀 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.
216+
🚀 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.
217217

218218

219219
## Legal Notices

0 commit comments

Comments
 (0)