skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Use Reports in Applications
    • System Requirements
    • Forums
    • Videos
    • Blogs
    • Submit a Ticket
    • FAQs
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now
Search all

Class RedisStorage

IStorage implementation using Redis server (redis.io).

Inheritance
System.Object
RedisStorage
Namespace: Telerik.Reporting.Cache.StackExchangeRedis
Assembly: Telerik.Reporting.Cache.StackExchangeRedis.dll

Syntax

public class RedisStorage : IStorage
Remarks

RedisStorage connects to Redis server using the StackExchange.Redis () client. Redis server provides built-in application locks mechanism which RedisStorage implementation utilizes. This makes it suitable for both single and multiple service instance deployment.

Constructors

RedisStorage(ConnectionMultiplexer)

Initializes a new instance of the RedisStorage class.

Declaration
public RedisStorage(ConnectionMultiplexer connection)
Parameters
StackExchange.Redis.ConnectionMultiplexer connection

An object hiding the Redis connection details. Should be reused (static/ shared) for each request.

RedisStorage(ConnectionMultiplexer, String)

Initializes a new instance of the RedisStorage class.

Declaration
public RedisStorage(ConnectionMultiplexer connection, string keysPrefix)
Parameters
StackExchange.Redis.ConnectionMultiplexer connection

An object hiding the Redis connection details. Should be reused (static/ shared) for each request.

System.String keysPrefix

String prefix that should be applied on each key stored in the Redis database. This allows shared usage of one Redis database.

RedisStorage(ConnectionMultiplexer, String, Int32)

Initializes a new instance of the RedisStorage class.

Declaration
[Obsolete("This constructor is now obsolete. Instantiate a ConnectionMultiplexer using a ConfigurationOptions with defaultDatabase key set.")]
public RedisStorage(ConnectionMultiplexer connection, string keysPrefix, int databaseNumber)
Parameters
StackExchange.Redis.ConnectionMultiplexer connection

An object hiding the Redis connection details. Should be reused (static/ shared) for each request.

System.String keysPrefix

String prefix that should be applied on each key stored in the Redis database. This allows shared usage of one Redis database.

System.Int32 databaseNumber

Determines the number of the database that should be used.

Properties

LockTimeout

Gets or sets the acquired lock timeout in seconds. When expired, lock is released. Default timeout is 3 seconds.

Declaration
public int LockTimeout { get; set; }
Property Value
System.Int32

Methods

AcquireLock(String)

Acquires a lock on a named resource.

Declaration
public IDisposable AcquireLock(string key)
Parameters
System.String key

Returns
System.IDisposable

Implements
IStorage.AcquireLock(String)
See Also
AcquireLock(System.String)

AcquireReadLock(String)

Declaration
public IDisposable AcquireReadLock(string key)
Parameters
System.String key

Returns
System.IDisposable

Implements
IStorage.AcquireReadLock(String)

AddInSet(String, String)

Adds a single string value to a set of values denoted from the given key.

Declaration
public void AddInSet(string key, string value)
Parameters
System.String key

System.String value

Implements
IStorage.AddInSet(String, String)
See Also
AddInSet(System.String, System.String)

Delete(String)

Deletes a key with its value (string or byte array) from the storage.

Declaration
public void Delete(string key)
Parameters
System.String key

Implements
IStorage.Delete(String)
See Also
Delete(System.String)

DeleteInSet(String, String)

Deletes a single string value from a set of values denoted from the given key.

Declaration
public bool DeleteInSet(string key, string value)
Parameters
System.String key

System.String value

Returns
System.Boolean

Implements
IStorage.DeleteInSet(String, String)
See Also
DeleteInSet(System.String, System.String)

DeleteSet(String)

Deletes a key with its values from the storage.

Declaration
public void DeleteSet(string key)
Parameters
System.String key

Implements
IStorage.DeleteSet(String)

Exists(String)

Retrieves a value indicating if a single value (string or byte array) exists in the storage.

Declaration
public bool Exists(string key)
Parameters
System.String key

Returns
System.Boolean

Implements
IStorage.Exists(String)
See Also
Exists(System.String)

ExistsInSet(String, String)

Retrieves a value indicating if a set of values exists in the storage.

Declaration
public bool ExistsInSet(string key, string value)
Parameters
System.String key

System.String value

Returns
System.Boolean

Implements
IStorage.ExistsInSet(String, String)
See Also
ExistsInSet(System.String, System.String)

GetAllMembersInSet(String)

Retrieves all members in a set of string values.

Declaration
public IEnumerable<string> GetAllMembersInSet(string key)
Parameters
System.String key

Returns
System.Collections.Generic.IEnumerable<System.String>

Implements
IStorage.GetAllMembersInSet(String)
See Also
GetAllMembersInSet(System.String)

GetBytes(String)

Retrieves a byte array value stored under particular key.

Declaration
public byte[] GetBytes(string key)
Parameters
System.String key

Returns
System.Byte[]

Implements
IStorage.GetBytes(String)
See Also
GetBytes(System.String)

GetCountInSet(String)

Retrieves the count of the values in a set value stored in the storage.

Declaration
public long GetCountInSet(string key)
Parameters
System.String key

Returns
System.Int64

Implements
IStorage.GetCountInSet(String)
See Also
GetCountInSet(System.String)

GetString(String)

Retrieves a string value stored under particular key.

Declaration
public string GetString(string key)
Parameters
System.String key

Returns
System.String

Implements
IStorage.GetString(String)
See Also
GetString(System.String)

SetBytes(String, Byte[])

Stores a byte array value under particular key.

Declaration
public void SetBytes(string key, byte[] value)
Parameters
System.String key

System.Byte[] value

Implements
IStorage.SetBytes(String, Byte[])
See Also
SetBytes(System.String, System.Byte[])

SetString(String, String)

Stores a string value under particular key.

Declaration
public void SetString(string key, string value)
Parameters
System.String key

System.String value

Implements
IStorage.SetString(String, String)
See Also
SetString(System.String, System.String)
Getting Started
  • Install Now
  • Online Demos
Support Resources
  • Documentation
  • Knowledge Base
  • Videos
  • Reporting Samples Repository
  • Reporting Release History
Community
  • Forums
  • Blogs
  • Reporting Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.