Skip to content

Commit 4c85046

Browse files
committed
M3 - exercise "final" updates
1 parent cc338b3 commit 4c85046

1 file changed

Lines changed: 30 additions & 8 deletions

File tree

Instructions/Labs/LAB_AK_03_develop_code_features.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ Use the following steps to complete this section of the exercise:
698698
}
699699
else
700700
{
701-
Console.WriteLine($"\"{book.Title}\" is on loan to another patron. The return due date is {loan.DueDate.ToString()}.");
701+
Console.WriteLine($"\"{book.Title}\" is on loan to another patron. The return due date is {loan.DueDate}.");
702702
}
703703
704704
return ConsoleState.PatronDetails;
@@ -723,7 +723,7 @@ Use the following steps to complete this section of the exercise:
723723
724724
If you're unsure about the suggested updates, you can accept changes and then ask GitHub Copilot for an explanation. You can revert the edits if you decide against the updates.
725725
726-
> **NOTE**: If GitHub Copilot suggests formatting dates using culture-specific formats, you may need to add the following using statement to the ConsoleApp.cs file: `using System.Globalization;`
726+
> **NOTE**: If GitHub Copilot suggests formatting the return date using a culture-specific format, ensure that a `using System.Globalization;` statement is added to top of the ConsoleApp.cs file.
727727
728728
1. Ensure that you've accepted updates in both the ConsoleApp.cs and Program.cs files.
729729
@@ -801,9 +801,9 @@ Use the following steps to complete this section of the exercise:
801801
802802
1. Stop the debug session.
803803
804-
1. Open the **Loans.json** file.
804+
1. Use the EXPLORER view to locate and then open the **Loans.json** file.
805805
806-
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.
806+
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 for Book One and Book Nineteen is correct.
807807
808808
The updated Loans.json file should be located in either the **Library.Console\bin\Debug\net8.0\Json** folder or **Library.Console\Json** folder.
809809
@@ -813,20 +813,22 @@ Use the following steps to complete this section of the exercise:
813813
814814
1. Verify that loan ID 37 and loan ID 46 are both for Book One (**"BookItemId": 1**).
815815
816+
The loan IDs are listed sequentially in the Loans.json file.
817+
816818
- Loan ID 37 should have a **ReturnDate** value of **2024-01-17**, indicating that the book was returned on that date.
817819
- 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).
818820
819821
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.
820822
821-
1. Verify that loan ID 34 is for Book Nineteen (**"BookItemId": 19**) and that the **ReturnDate** value is set to **2023-12-29**.
823+
1. Verify that loan ID 34 is for Book Nineteen (**"BookItemId": 19**) and that the **ReturnDate** has been assigned a value.
822824
823825
### Sync your changes with the remote repository
824826
825827
1. Select the Source Control view.
826828
827829
1. Ensure that the files you updated are listed under **Changes**.
828830
829-
You should see the CommonActions.cs and ConsoleApp.cs files listed under **Changes**.
831+
You should see the CommonActions.cs and ConsoleApp.cs files listed under **Changes**. The Program.cs file may also be listed.
830832
831833
1. Use GitHub Copilot to generate a message for the **Commit**.
832834
@@ -855,13 +857,33 @@ Use the following steps to complete this section of the exercise:
855857
856858
1. Under **Add a description**, select the Copilot Actions button (the GitHub Copilot icon), and then select the option to generate a summary.
857859
858-
> **NOTE**: If you're using a GitHub Copilot Free account, you won't see the option to automatically generate a pull request summary using Copilot. You can still create the pull request, but you'll need to write your own summary.
860+
> **NOTE**: The GitHub Copilot Free plan doesn't support the pull request summary feature at this time.
861+
862+
If you're using the GitHub Copilot Free plan, you can write your own summary, or use the summary below to complete the pull request.
863+
864+
```plaintext
865+
866+
This pull request introduces a new feature to the library console application: the ability to search for books and check their availability. It also includes updates to dependency injection and the CommonActions enumeration to support this functionality. Below are the most important changes grouped by theme.
867+
868+
New Feature: Book Search
869+
870+
Added a new SearchBooks action to the CommonActions enumeration (src/Library.Console/CommonActions.cs).
871+
872+
Updated PatronDetails method to handle the SearchBooks action, including a new SearchBooks method that allows users to search for a book by title and check its availability (src/Library.Console/ConsoleApp.cs).
873+
874+
Modified ReadInputOptions and WriteInputOptions methods to include the new SearchBooks option (src/Library.Console/ConsoleApp.cs).
875+
876+
Dependency Injection Updates
877+
878+
Added JsonData as a dependency in the ConsoleApp constructor and ensured it is registered in the DI container before ConsoleApp (src/Library.Console/ConsoleApp.cs, src/Library.Console/Program.cs).
879+
880+
```
859881
860882
1. Once the summary is generated, select **Preview**.
861883
862884
1. Take a minute to review the summary.
863885
864-
The generated pull request summary should be similar to the following example:
886+
The pull request summary generated by GitHub Copilot should be similar to the following example:
865887
866888
![Screenshot showing a pull request summary generated using a GitHub Copilot Enterprise account.](./Media/m03-github-copilot-pull-request-summary.png)
867889

0 commit comments

Comments
 (0)