🖋️
StackExchange Redis Extensions
  • Home
  • Setup
  • Dependency Injection
  • Configuration
    • C# Configuration
    • Json Configuration
    • XML Configuration
  • Serializers
    • Newtonsoft Json.Net
    • MsgPack
    • System.Text.Json
  • Packages
  • Usage
    • Add, retrieve and remove complex object
    • Replace an object
    • Work with multiple items
    • Custom serializer
  • ASP.NET Core
    • Expose redis information
  • Helpful link
  • License
  • Work with the code
    • Unit tests
  • Usages
Powered by GitBook
On this page

Was this helpful?

ASP.NET Core

If you are running into ASP.NET Core application, there is a specific package that you can use in order to make StackExchange.Redis.Extensions configuration easier.

Install-Package StackExchange.Redis.Extensions.AspNetCore
dotnet add package StackExchange.Redis.Extensions.AspNetCore
<PackageReference Include="StackExchange.Redis.Extensions.AspNetCore" Version="6.1.0" />
paket add StackExchange.Redis.Extensions.AspNetCore

Startup.cs

Into your startup class,

public void ConfigureServices(IServiceCollection services)
{
    // Retrieve the configuration fro your json/xml file

    services.AddStackExchangeRedisExtensions<NewtonsoftSerializer>(conf);
}I

Remember to install also you favorite serializer.

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    app.UserRedisInformation();
}

PreviousCustom serializerNextExpose redis information

Last updated 5 years ago

Was this helpful?