Application state

Application state was used in previous frameworks prior to ASP.NET Core, for example, in ASP.NET MVC 4. It has now transitioned to being known as app state in ASP.NET Core 3. In its simplest terms, it is just a representation of the state of an application at a snapshot in time. When we refer to an application state, it will be the same for all the application users at the specified time. This allows us to keep data that remains constant across all the client users.

When you have this kind of data in a system that needs to be accessed across sessions and only changes every once in a while, it is advised to use caching. ASP.NET Core 3 prefers the usage of caching in favor of the application state.

Caching in ASP.NET Core 3 is achieved by using IMemoryCache and adding services.AddMemoryCache() to the ConfigureServices method, but it's out of the scope of this book. You can find more information at the following link: https://docs.microsoft.com/en-us/aspnet/core/performance/caching/memory?view=aspnetcore-3.0.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.124.145