Posts

Showing posts from June 20, 2025

Attendance App: Real-Time Use of DI Lifetimes

Attendance App - Real-Time DI Lifetimes in ASP.NET Core 📲 Attendance App: Real-Time Use of DI Lifetimes in ASP.NET Core Dependency Injection (DI) in ASP.NET Core isn't just a theoretical pattern — it becomes powerful when applied to real-world applications. In this guide, we'll explore how an Attendance App leverages different DI lifetimes (Singleton, Scoped, Transient) to manage services such as logging, attendance, OTP generation, and email notifications. 🎯 App Features Students check-in/out Admins manage students Operations are logged (Singleton) Attendance tracked per request (Scoped) Email/OTP as lightweight utilities (Transient) 🔁 1. Service Lifetimes in Real Context Service Lifetime Why? ILoggingService Singleton One instance logs everything app-wide AttendanceService Scoped...