Showing posts from November, 2022

Implementing Distributed Caching in ASP.NET Core 6 using the Redis Cache In Microsoft Azure

In this article, we will implement distributed caching for ASP.NET Core 6 applications using Redis Cache in Microsoft Azure. In highly responsive web applications as well as in Microservices applications caching plays a very important role. We use caching to store data so that it can be made available to the application at a fast speed when it is required. In ASP.NET Core, we can have caching implemented using In-Memory Cache and Distributed Cache. The Caching Concept A Cache is a mechanism using which the frequently demanded data is stored for a specific duration. Typically, the data required for searching can be stored in the cache and hence this helps to reduce the number of calls to the actual database. Since the data is immediately available to the application, the number of resource requirements e.g. waiting time for the Db Connections can be reduced and hence this results in the performance increase of the application.  The question is what type of data can be stored in the cach

Implementing Server-Side Pagination using ASP.NET Core API and React.js 3

In this article, we will perform server-side pagination using ASP.NET Core API, Entity Framework Core, and the React.js front-end. We should choose the option of server-side pagination when the server returns a large amount of data. The pagination makes sure that the front end is provided with a limited set of data so that the response to the client application is as lightweight as possible. To implement the code for this article I have used the Northwind database. Scrips for the Northwind can be downloaded from this link .    Figure 1 will provide an idea of the implementation   Figure 1: The Application Implementation    For fetching a specific number of records from the table, we can use LINQ with Skip() and Take() methods. I have used the LINQ with Entity Framework Core to implement the server-side pagination.   Once the Northwind database is created, we can see various tables in it. Some of the tables contain Null values. So I have used the query as shown in Listing 1 to create a