Implementing Redis in ASP.NET Core
So, let's use the Redis we just installed on our machines by integrating it with our existing ASP.NET Core 5 solution. Here are the steps:
- Go to the
Travel.Applicationproject and install these NuGet packages. The following NuGet package is a distributed cache implementation of theMicrosoft.Extensions.Caching.StackExchangeRedisnamespace using Redis:Microsoft.Extensions.Caching.StackExchangeRedis
The following NuGet package helps us retrieve the configuration in
appsettings.json:Microsoft.Extensions.Configuration
The following NuGet package is a JSON framework for .NET:
Newtonsoft.Json
- Next, we update the
DependencyInjection.csfile of theTravel.Applicationproject with the following code:namespace Travel.Application {     public static class DependencyInjection     {         public static IServiceCollection        &...