How to Lazy Loading Cache in ASP.NET Core
In-Memory Cache refers to a high-speed memory section which is dedicated for storing and accessing less frequently updated but read data.
A Singleton service instance once created is reused for the entire application lifetime, whereas a Transient service instance is created every time a calling method or dependent class requests for it from the container.
A scoped service instance is created only once within a request scope and is reused for all calls within that request.
services.AddScoped<IMyClass, MyClass>();
A transient service instance is created each time a calling component method or dependent class requests for an instance from the container.
services.AddTransient<IMyClass, MyClass>();
A singleton service instance is created only once during entire application lifetime, common across all requests.
services.AddSingleton<IMyClass, MyClass>();