Skip to content

Enigpus Library Project Enigpus Library houses various types of books, including novels and magazines. Novels are characterized by their code, title, publisher, year of publication, and author. Magazines, on the other hand, only have a code, title, publisher, and year of publication. Every book in Enigpus is recorded in an inventory log.

Notifications You must be signed in to change notification settings

Mechiuw/ASP.NET_Core_8-Enigpus-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Library Book Management App

Table of Contents

Overview

This project is a console-based Library Book Management Application written in C#. It is designed to help manage books in a library, including adding new books, updating book information, deleting books, and searching for books. This application provides a simple interface to perform these tasks efficiently.

Features

  • Add New Books: Add details of new books to the library.
  • Update Book Information: Modify the details of existing books.
  • Delete Books: Remove books from the library.
  • Search Books: Search for books by title, author, or ISBN.
  • List All Books: Display a list of all books in the library.

User allowed features

  • Add New Books
  • Search Books
  • List All Books

Prerequisites

  • .NET Core SDK 8.0

  • Visual Studio Code

  • Contact

For any questions, suggestions, or feedback, please feel free to contact me:

Usage

Service Layer (novel & magazine) :

Add Book :

 public NovelResponse Create(NovelRequest novelRequest)
    {
        Novel novel = new(
            novelRequest.Id,
            novelRequest.Title,
            novelRequest.Author,
            novelRequest.Year,
            novelRequest.Writer);
        _novelRepo.Add(novel);

        return new NovelResponse(
            novel.Id,
            novel.Title,
            novel.Author,
            novel.Year,
            novel.Writer);
    }

public MagazineResponse MagCreate(MagazineRequest magazineRequest){
        Magazine magazine = new(
            magazineRequest.Id,
            magazineRequest.Title,
            magazineRequest.Author,
            magazineRequest.Year
        );

        _magazineRepo.Add(magazine);
        return new MagazineResponse(
            magazine.Id,
            magazine.Title,
            magazine.Author,
            magazine.Year
        );
    }

Get All Book (Novel & Magazine) :

public List<Novel> GetAll()
    {
        return new List<Novel>(_novelRepo);
    }

public List<Magazine> MagGetAll(){
        return new List<Magazine>(_magazineRepo);
    }

Get By Id Book (Novel & Magazine) :

public NovelResponse GetById(String Id)
    {
        Novel foundNovel = _novelRepo.FirstOrDefault(x => x.Id == Id);
        if(foundNovel != null){
            return new NovelResponse(
                foundNovel.Id,
                foundNovel.Title,
                foundNovel.Author,
                foundNovel.Year,
                foundNovel.Writer
            );
        } else {
            throw new Exception(String.Format("couldn't find any novel with id : {0}",Id));
        }
    }

public MagazineResponse MagGetById(string Id){
        Magazine foundMagazine = _magazineRepo.FirstOrDefault(x => x.Id == Id);
        if(foundMagazine != null){
            return new MagazineResponse(
                foundMagazine.Id,
                foundMagazine.Title,
                foundMagazine.Author,
                foundMagazine.Year
            );
        } else {
            throw new Exception(String.Format("couldn't find any magazine with id : {0}",Id));
        }
    }

About

Enigpus Library Project Enigpus Library houses various types of books, including novels and magazines. Novels are characterized by their code, title, publisher, year of publication, and author. Magazines, on the other hand, only have a code, title, publisher, and year of publication. Every book in Enigpus is recorded in an inventory log.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages