Skip to content
Docs Try Aspire

RedisResource Methods

Class Methods 1 member
A resource that represents a Redis resource independent of the hosting model.
GetConnectionStringAsync(CancellationToken) Section titled GetConnectionStringAsync(CancellationToken) ValueTask<string?>
Gets the connection string for the Redis server.
public class RedisResource
{
public ValueTask<string?> GetConnectionStringAsync(
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
cancellationToken CancellationToken optional A Threading.CancellationToken to observe while waiting for the task to complete.
ValueTask<string?> A connection string for the redis server in the form "host:port".