Skip to content

Add book search functionality and repository interface - #44

Open
kkk-acn wants to merge 1 commit into
MicrosoftLearning:mainfrom
kkk-acn:book-abailavle
Open

Add book search functionality and repository interface#44
kkk-acn wants to merge 1 commit into
MicrosoftLearning:mainfrom
kkk-acn:book-abailavle

Conversation

@kkk-acn

@kkk-acn kkk-acn commented Aug 10, 2026

Copy link
Copy Markdown

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.

New Feature: Book Search

Added a new SearchBooks action to the CommonActions enumeration (src/Library.Console/CommonActions.cs).

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).

Modified ReadInputOptions and WriteInputOptions methods to include the new SearchBooks option (src/Library.Console/ConsoleApp.cs).

Dependency Injection Updates

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).

- Introduced `SearchBooks` method in `ConsoleApp` to allow users to search for book availability.
- Updated `CommonActions` enum to include `SearchBooks` action.
- Created `IBookRepository` interface for book-related data operations.
- Implemented `JsonBookRepository` class to handle book searches and loan retrievals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant