# NRedisStack guide (C#/.NET)

```json metadata
{
  "title": "NRedisStack guide (C#/.NET)",
  "description": "Connect your .NET application to a Redis database",
  "categories": ["docs","develop","stack","oss","rs","rc","oss","kubernetes","clients"],
  "tableOfContents": {"sections":[{"id":"install","title":"Install"},{"id":"connect-and-test","title":"Connect and test"},{"id":"redis-open-source-modules","title":"Redis Open Source modules"},{"id":"more-information","title":"More information"}]}
}
```














[NRedisStack](https://github.com/redis/NRedisStack) is the .NET client for Redis.
The sections below explain how to install `NRedisStack` and connect your application
to a Redis database.

`NRedisStack` requires a running Redis server. See [here](https://redis.io/docs/latest/operate/oss_and_stack/install/) for Redis Open Source installation instructions.

You can also access Redis with an object-mapping client interface. See
[Redis OM for .NET](https://redis.io/docs/latest/integrate/redisom-for-net)
for more information.

## Install

Using the `dotnet` CLI, run:

```bash
dotnet add package NRedisStack
```

## Connect and test

Add the following imports to your source file:




Connect to localhost on port 6379. The client supports both synchronous and asynchronous commands.




You can test the connection by storing and retrieving a simple string.




Store and retrieve a HashMap.




## Redis Open Source modules

To access Redis Open Source capabilities, use the appropriate interface like this:

```cs
IBloomCommands bf = db.BF();
ICuckooCommands cf = db.CF();
ICmsCommands cms = db.CMS();
IGraphCommands graph = db.GRAPH();
ITopKCommands topk = db.TOPK();
ITdigestCommands tdigest = db.TDIGEST();
ISearchCommands ft = db.FT();
IJsonCommands json = db.JSON();
ITimeSeriesCommands ts = db.TS();
```

## More information

See the other pages in this section for more information and examples.
