Menu

Singleton, LINQ, and the bugs I found later in my C# library system
📰

Singleton, LINQ, and the bugs I found later in my C# library system

DEV Community: csharp·Ahmed Gamal·7 days ago
#pSA1eItv
#devtocsharp#devto#dev#book#library
Long article (1616 words) — no AI summary yet.
Reading 0:00
15s threshold

This is the third project I have written up from my GitHub, and it is the one where the design decisions are easiest to defend in a README and hardest to defend in the code. A library management console app sounds like a beginner exercise, but it forces you to answer real questions: who owns the book list, how do two roles share one data store, and what happens to a book when someone borrows it.

The repository is here: https://github.com/AGA7474/Library-Management-System-Advanced-OOP

The shape of the model

Two roles, one base class:

internal class User { public string Name { get ; set ; }

public void Display ( ) { Library lib = Library . GetObject ( ) ; lib .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.