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: Instructions/Labs/LAB_AK_02_analyze_document_code.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ Use the following steps to complete this section of the exercise:
112
112
@workspace describe this project
113
113
```
114
114
115
-
Use Chat participants, such as the `@workspace`, to scope your prompt to a specific domain. Chat participants are like domain experts who have a specialty that they can help you with. Use @workspace when you want GitHub Copilot to consider the structure of your project, how different parts of your code interact, or design patterns in your project.
115
+
Use Chat participants, such as the **@workspace**, to scope your prompt to a specific domain. Chat participants are like domain experts who have a specialty that they can help you with. Use @workspace when you want GitHub Copilot to consider the structure of your project, how different parts of your code interact, or design patterns in your project.
116
116
117
117
To see a list of all available chat participants, type **@** in the chat prompt box.
118
118
@@ -338,15 +338,15 @@ Use the following steps to complete this section of the exercise:
338
338
339
339
1. Verify that the message "Book was successfully returned." is displayed.
340
340
341
-
The message "Book was successfully returned." should be followed by the book details. Returned books are marked with `Returned: True`.
341
+
The message "Book was successfully returned." should be followed by the book details. Returned books are marked with **Returned: True**.
342
342
343
343
1. To begin a new search, type **s** and then press Enter.
344
344
345
345
1. When prompted for a patron name, type **One** and then press Enter.
346
346
347
347
1. At the "Input Options" prompt, type **2** and then press Enter.
348
348
349
-
1. Verify that first book loan is marked `Returned: True`.
349
+
1. Verify that first book loan is marked **Returned: True**.
350
350
351
351
1. At the "Input Options" prompt, type **q** and then press Enter.
352
352
@@ -365,7 +365,7 @@ You need a README file that includes the following sections:
365
365
- **Usage**: Instructions on how to use the project, often including code examples.
366
366
- **License**: The license that the project is under.
367
367
368
-
In this section of the exercise, you'll use GitHub Copilot to create project documentation and add it to a `README.md` file.
368
+
In this section of the exercise, you'll use GitHub Copilot to create project documentation and add it to a **README.md** file.
369
369
370
370
Use the following steps to complete this section of the exercise:
Copy file name to clipboardExpand all lines: Instructions/Labs/LAB_AK_03_develop_code_features.md
+49-49Lines changed: 49 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -168,26 +168,26 @@ In this section of the exercise, you use GitHub Copilot to develop a new feature
168
168
169
169
To implement the book availability feature, you'll need to complete the following updates:
170
170
171
-
- Add a new `SearchBooks` action to the `CommonActions` enum in CommonActions.cs.
171
+
- Add a new **SearchBooks** action to the **CommonActions** enum in CommonActions.cs.
172
172
173
-
- Update the `WriteInputOptions` method in ConsoleApp.cs.
173
+
- Update the **WriteInputOptions** method in ConsoleApp.cs.
174
174
175
-
- Add support for the new `CommonActions.SearchBooks` option.
175
+
- Add support for the new **CommonActions.SearchBooks** option.
176
176
- Display the option to check if a book is available for loan.
177
177
178
-
- Update the `ReadInputOptions` method in ConsoleApp.cs.
178
+
- Update the **ReadInputOptions** method in ConsoleApp.cs.
179
179
180
-
- Add support for the new `CommonActions.SearchBooks` option.
180
+
- Add support for the new **CommonActions.SearchBooks** option.
181
181
182
-
- Update the `PatronDetails` method in ConsoleApp.cs.
182
+
- Update the **PatronDetails** method in ConsoleApp.cs.
183
183
184
-
- Add `CommonActions.SearchBooks` to `options` before calling `ReadInputOptions`.
185
-
- Add an `else if` to handle the `SearchBooks` action.
186
-
- The `else if` block should call a new method named `SearchBooks`.
184
+
- Add **CommonActions.SearchBooks** to **options** before calling **ReadInputOptions**.
185
+
- Add an **else if** to handle the **SearchBooks** action.
186
+
- The **else if** block should call a new method named **SearchBooks**.
187
187
188
-
- Create a new `SearchBooks` method in ConsoleApp.cs.
188
+
- Create a new **SearchBooks** method in ConsoleApp.cs.
189
189
190
-
- The `SearchBooks` method should read a user provided book title.
190
+
- The **SearchBooks** method should read a user provided book title.
191
191
- Check if a book is available for loan, and display a message stating either:
192
192
193
193
- "`book.title` is available for loan", or
@@ -208,17 +208,17 @@ Use the following steps to complete this section of the exercise:
208
208
209
209
1. Expand the **Library.Console** project.
210
210
211
-
1. Open the CommonActions.cs file, and then select the `CommonActions` enum.
211
+
1. Open the CommonActions.cs file, and then select the **CommonActions** enum.
212
212
213
-
You need to add a new `SearchBooks` action to `CommonActions`.
213
+
You need to add a new **SearchBooks** action to **CommonActions**.
214
214
215
215
1. Open the inline chat and then enter the following prompt:
216
216
217
217
```plaintext
218
218
Update selection to include a new `SearchBooks` action.
219
219
```
220
220
221
-
GitHub Copilot should suggest a code update that adds the new `SearchBooks` action to the `CommonActions` enum.
221
+
GitHub Copilot should suggest a code update that adds the new **SearchBooks** action to the **CommonActions** enum.
222
222
223
223
1. Review the suggested update and then select **Accept**.
224
224
@@ -242,17 +242,17 @@ Use the following steps to complete this section of the exercise:
242
242
243
243
1. Open the ConsoleApp.cs file.
244
244
245
-
1. Find and then select the `WriteInputOptions` method.
245
+
1. Find and then select the **WriteInputOptions** method.
246
246
247
-
You need to add support for the new `CommonActions.SearchBooks` option. If the `SearchBooks` option is flagged, display the option to check if a book is available for loan.
247
+
You need to add support for the new **CommonActions.SearchBooks** option. If the **SearchBooks** option is flagged, display the option to check if a book is available for loan.
248
248
249
249
1. Open the inline chat and then enter the following prompt:
250
250
251
251
```plaintext
252
252
Update selection to include an option for the `CommonActions.SearchBooks` action. Use the letter "b" and the message "to check for book availability".
253
253
```
254
254
255
-
GitHub Copilot should suggest a code update that adds a new `if` block for the `SearchBooks` action.
255
+
GitHub Copilot should suggest a code update that adds a new **if** block for the **SearchBooks** action.
256
256
257
257
1. Review the suggested update and then select **Accept**.
258
258
@@ -295,17 +295,17 @@ Use the following steps to complete this section of the exercise:
295
295
296
296
```
297
297
298
-
1. Scroll up slightly to find and then select the `ReadInputOptions` method.
298
+
1. Scroll up slightly to find and then select the **ReadInputOptions** method.
299
299
300
-
Once again, you need to add support for the new `CommonActions.SearchBooks` option. Include a case that handles the user selecting the `SearchBooks` action.
300
+
Once again, you need to add support for the new **CommonActions.SearchBooks** option. Include a case that handles the user selecting the **SearchBooks** action.
301
301
302
302
1. Open the inline chat and then enter the following prompt:
303
303
304
304
```plaintext
305
305
Update selection to include an option for the `CommonActions.SearchBooks` action.
306
306
```
307
307
308
-
GitHub Copilot should suggest an update that adds a new `case` that handles the user selecting the `SearchBooks` action.
308
+
GitHub Copilot should suggest an update that adds a new **case** that handles the user selecting the **SearchBooks** action.
309
309
310
310
1. Review the suggested update and then select **Accept**.
311
311
@@ -345,12 +345,12 @@ Use the following steps to complete this section of the exercise:
345
345
346
346
```
347
347
348
-
1. Scroll down to find and then select the `PatronDetails` method.
348
+
1. Scroll down to find and then select the **PatronDetails** method.
349
349
350
350
There are two things that you need to accomplish:
351
351
352
-
- You need to add `CommonActions.SearchBooks` to `options` before calling `ReadInputOptions`.
353
-
- You also need to add an `else if` to handle the `SearchBooks` action. The `else if` block should call a new method named `SearchBooks`.
352
+
- You need to add **CommonActions.SearchBooks** to **options** before calling **ReadInputOptions**.
353
+
- You also need to add an **else if** to handle the **SearchBooks** action. The **else if** block should call a new method named **SearchBooks**.
354
354
355
355
You can address both requirements with the same prompt.
356
356
@@ -360,7 +360,7 @@ Use the following steps to complete this section of the exercise:
360
360
Update selection to add `CommonActions.SearchBooks` to `options` before calling `ReadInputOptions`. Add an `else if` block to handle the `SearchBooks` action. The `else if` block should call a new method named `SearchBooks`.
361
361
```
362
362
363
-
GitHub Copilot should suggest a code update that adds `CommonActions.SearchBooks` to `options` before calling `ReadInputOptions`.
363
+
GitHub Copilot should suggest a code update that adds **CommonActions.SearchBooks** to **options** before calling **ReadInputOptions**.
364
364
365
365
1. Review the suggested update and then select **Accept**.
366
366
@@ -421,42 +421,42 @@ Use the following steps to complete this section of the exercise:
421
421
422
422
```
423
423
424
-
> **NOTE**: The code suggested by Inline chat may include stub code for the `SearchBooks` method. You can accept that code. You'll implement the `SearchBooks` method in the next section.
424
+
> **NOTE**: The code suggested by Inline chat may include stub code for the **SearchBooks** method. You can accept that code. You'll implement the **SearchBooks** method in the next section.
425
425
426
426
### Implement a SearchBooks method using the Chat view
427
427
428
-
There's one step remaining to implement the "book availability" updates, create the `SearchBooks` method. The `SearchBooks` method will read a user provided book title, check if a book is available for loan, and display a message indicating the book's availability status. You'll use the Chat view to evaluate the requirements and implement the `SearchBooks` method.
428
+
There's one step remaining to implement the "book availability" updates, create the **SearchBooks** method. The **SearchBooks** method will read a user provided book title, check if a book is available for loan, and display a message indicating the book's availability status. You'll use the Chat view to evaluate the requirements and implement the **SearchBooks** method.
429
429
430
430
GitHub Copilot's Chat view provides a conversational and interactive environment that isn't available when using inline chat. You can use the Chat view to ask questions, request code suggestions, and get explanations for the code generated by GitHub Copilot. The Chat view supports the following three modes:
431
431
432
432
- Ask mode: Ask mode is used to gain a better understanding of your codebase, brainstorm ideas, and help with coding tasks. The code suggestions generated in Ask mode can be implemented directly into your codebase or copied to the clipboard.
433
433
- Edit mode: Edit mode is used to make changes to your code, such as refactoring or adding new features. Edit mode can make edits across multiple files in your project.
434
434
- Agent mode: Agent mode is used to define a high-level task and to start an agentic code editing session to accomplish that task. In agent mode, Copilot autonomously plans the work needed and determines the relevant files and context. The agent can make changes to your code, run tests, and even deploy your application.
435
435
436
-
You'll be u the Ask and Edit modes to implement the `SearchBooks` method.
436
+
You'll be u the Ask and Edit modes to implement the **SearchBooks** method.
437
437
438
438
Use the following steps to complete this section of the exercise:
439
439
440
-
1. Take a minute to consider the process requirements for the `SearchBooks` method.
440
+
1. Take a minute to consider the process requirements for the **SearchBooks** method.
441
441
442
442
What's the process that the method needs to complete? What's the return type for this method? Does it require parameters?
443
443
444
-
The `SearchBooks` method should implement the following process:
444
+
The **SearchBooks** method should implement the following process:
445
445
446
446
1. Prompt the user for a book title.
447
447
1. Read the user provided book title.
448
448
1. Check if a book is available for loan.
449
449
1. Display a message stating one of the following options:
450
450
451
451
- "`book.title` is available for loan"
452
-
- "`book.title` is on loan to another patron. The return due date is `loan.DueDate`.
452
+
- "`book.title` is on loan to another patron. The return due date is `loan.DueDate`."
453
453
454
454
To build the message options, your code will need to access the following JSON files:
455
455
456
-
- `Books.json` is needed to find the matching `Title` and `BookId`.
457
-
- `Loans.json` is needed to find the `ReturnDate` and `DueDate` for the matching `BookItemId`. The `BookItemId` is the same as the `BookId` in `Books.json`.
456
+
- **Books.json** is needed to find the matching **Title** and **BookId**.
457
+
- **Loans.json** is needed to find the **ReturnDate** and **DueDate** for the matching **BookItemId**. The **BookItemId** is the same as the **BookId** in **Books.json**.
458
458
459
-
1. Ensure that you have the following `SearchBooks` method created in the ConsoleApp.cs file:
459
+
1. Ensure that you have the following **SearchBooks** method created in the ConsoleApp.cs file:
460
460
461
461
```csharp
462
462
@@ -507,7 +507,7 @@ Use the following steps to complete this section of the exercise:
507
507
508
508
1. In the code editor, to accept the suggested code, select **Keep**.
509
509
510
-
1. Select the `SearchBooks` method.
510
+
1. Select the **SearchBooks** method.
511
511
512
512
1. Use drag-and-drop operations to add the following files to the Chat context:
513
513
@@ -606,7 +606,7 @@ Use the following steps to complete this section of the exercise:
606
606
- JsonData.cs
607
607
- JsonLoanRepository.cs
608
608
609
-
1. Select the `SearchBooks` method.
609
+
1. Select the **SearchBooks** method.
610
610
611
611
1. Enter the following prompt:
612
612
@@ -622,7 +622,7 @@ Use the following steps to complete this section of the exercise:
622
622
623
623
**ConsoleApp.cs**
624
624
625
-
Code updates that add the `JsonData` dependency to the `ConsoleApp` constructor can be found near the top of the ConsoleApp class.
625
+
Code updates that add the **JsonData** dependency to the **ConsoleApp** constructor can be found near the top of the ConsoleApp class.
626
626
627
627
```csharp
628
628
@@ -639,7 +639,7 @@ Use the following steps to complete this section of the exercise:
639
639
640
640
```
641
641
642
-
Code updates that check if a book is available for loan can be found in the `SearchBooks` method.
642
+
Code updates that check if a book is available for loan can be found in the **SearchBooks** method.
643
643
644
644
```csharp
645
645
@@ -732,7 +732,7 @@ In this section of the exercise, you complete the following tasks:
732
732
733
733
### Test the "book availability" feature
734
734
735
-
Manual testing can be used to verify that the new feature works as expected. Using a data source that can be verified is important. In this case, you use the `Books.json` and `Loans.json` files to verify that the new feature reports the availability status of a book correctly.
735
+
Manual testing can be used to verify that the new feature works as expected. Using a data source that can be verified is important. In this case, you use the **Books.json** and **Loans.json** files to verify that the new feature reports the availability status of a book correctly.
736
736
737
737
Use the following steps to complete this section of the exercise:
738
738
@@ -770,24 +770,24 @@ Use the following steps to complete this section of the exercise:
770
770
771
771
1. Stop the debug session.
772
772
773
-
1. Open the `Loans.json` file.
773
+
1. Open the **Loans.json** file.
774
774
775
-
The `Loans.json` file is used to track the loan status of each book. You can use the `Loans.json` file to verify that the availability status of Book One and Book Two is correct.
775
+
The Loans.json file is used to track the loan status of each book. You can use the Loans.json file to verify that the availability status of Book One and Book Two is correct.
776
776
777
-
The updated `Loans.json` file should be located in either the `Library.Console\bin\Debug\net8.0\Json` folder or `Library.Console\Json` folder.
777
+
The updated Loans.json file should be located in either the **Library.Console\bin\Debug\net8.0\Json** folder or **Library.Console\Json** folder.
778
778
779
-
- If you're using the Visual Studio Code debugger to run the app, the updated `Loans.json` file should be located in the `Library.Console\bin\Debug\net8.0\Json` folder.
779
+
- If you're using the Visual Studio Code debugger to run the app, the updated Loans.json file should be located in the **Library.Console\bin\Debug\net8.0\Json** folder.
780
780
781
-
- If you're using a `dotnet run` command from the `AccelerateDevGHCopilot\src\Library.Console>` folder to run the app, the updated `Loans.json` file should be located in the `Library.Console\Json` folder.
781
+
- If you're using a **dotnet run** command from the **AccelerateDevGHCopilot\src\Library.Console** folder to run the app, the updated Loans.json file should be located in the **Library.Console\Json** folder.
782
782
783
-
1. Verify that loan ID 37 and loan ID 46 are both for Book One (`"BookItemId": 1`).
783
+
1. Verify that loan ID 37 and loan ID 46 are both for Book One (**"BookItemId": 1**).
784
784
785
-
- Loan ID 37 should have a `ReturnDate` value of `2024-01-17`, indicating that the book was returned on that date.
786
-
- Loan ID 46 should have a `ReturnDate` value `null`, indicating that the book is currently on loan (loaned on `2024-07-09` but not returned).
785
+
- Loan ID 37 should have a **ReturnDate** value of **2024-01-17**, indicating that the book was returned on that date.
786
+
- Loan ID 46 should have a **ReturnDate** value **null**, indicating that the book is currently on loan (loaned on **2024-07-09** but not returned).
787
787
788
-
The `ReturnDate` value is used to determine whether the book is currently on loan. If the `ReturnDate` value is `null`, the book is currently on loan.
788
+
The **ReturnDate** value is used to determine whether the book is currently on loan. If the **ReturnDate** value is **null**, the book is currently on loan.
789
789
790
-
1. Verify that loan ID 50 is for Book Three (`"BookItemId": 3`) and that the `ReturnDate` value is set to `2023-12-29`.
790
+
1. Verify that loan ID 50 is for Book Three (**"BookItemId": 3**) and that the **ReturnDate** value is set to **2023-12-29**.
791
791
792
792
### Sync your changes with the remote repository
793
793
@@ -836,7 +836,7 @@ Use the following steps to complete this section of the exercise:
836
836
837
837
1. If all checks pass and there are no conflicts with the base branch, select **Merge pull request**, and then select **Confirm merge**.
838
838
839
-
Notice that you can delete the `book-availability` branch after merging the changes. To delete the branch, select **Delete branch**.
839
+
Notice that you can delete the **book-availability** branch after merging the changes. To delete the branch, select **Delete branch**.
0 commit comments