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_03_develop_code_features.md
+30-8Lines changed: 30 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -698,7 +698,7 @@ Use the following steps to complete this section of the exercise:
698
698
}
699
699
else
700
700
{
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}.");
702
702
}
703
703
704
704
return ConsoleState.PatronDetails;
@@ -723,7 +723,7 @@ Use the following steps to complete this section of the exercise:
723
723
724
724
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.
725
725
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.
727
727
728
728
1. Ensure that you've accepted updates in both the ConsoleApp.cs and Program.cs files.
729
729
@@ -801,9 +801,9 @@ Use the following steps to complete this section of the exercise:
801
801
802
802
1. Stop the debug session.
803
803
804
-
1. Open the **Loans.json** file.
804
+
1. Use the EXPLORER view to locate and then open the **Loans.json** file.
805
805
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.
807
807
808
808
The updated Loans.json file should be located in either the **Library.Console\bin\Debug\net8.0\Json** folder or **Library.Console\Json** folder.
809
809
@@ -813,20 +813,22 @@ Use the following steps to complete this section of the exercise:
813
813
814
814
1. Verify that loan ID 37 and loan ID 46 are both for Book One (**"BookItemId": 1**).
815
815
816
+
The loan IDs are listed sequentially in the Loans.json file.
817
+
816
818
- Loan ID 37 should have a **ReturnDate** value of **2024-01-17**, indicating that the book was returned on that date.
817
819
- 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).
818
820
819
821
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.
820
822
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.
822
824
823
825
### Sync your changes with the remote repository
824
826
825
827
1. Select the Source Control view.
826
828
827
829
1. Ensure that the files you updated are listed under **Changes**.
828
830
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.
830
832
831
833
1. Use GitHub Copilot to generate a message for the **Commit**.
832
834
@@ -855,13 +857,33 @@ Use the following steps to complete this section of the exercise:
855
857
856
858
1. Under **Add a description**, select the Copilot Actions button (the GitHub Copilot icon), and then select the option to generate a summary.
857
859
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
+
```
859
881
860
882
1. Once the summary is generated, select **Preview**.
861
883
862
884
1. Take a minute to review the summary.
863
885
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:
865
887
866
888

0 commit comments