> For the complete documentation index, see [llms.txt](https://docs.eiffel.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eiffel.dev/features/caching/usage.md).

# Usage

{% hint style="info" %}
Before continue with this section please follow [configuration](/features/caching/configuration.md) steps.
{% endhint %}

After the configuration, you should install **Eiffel.Caching.Abstractions** NuGet package into your application. This package contains common interfaces such as [`ICacheService`](/features/caching/api/icacheservice.md), [`ICacheServiceFactory`](/features/caching/api/icacheservicefactory.md) etc.

```sh
dotnet add package Eiffel.Caching.Abstractions
```

In your application services, controllers or other infrastructure service you can use `ICacheService` with dependency injection.&#x20;

```csharp
public class BookingService
{
    private readonly ICacheService _cacheService;
    public BookingService(ICacheService cacheService)
    {
        _cacheService = cacheService;
    }
    
    .. // Your implementation details
}
```

If you want to separate your data between different indexes in Redis you can use `ICacheServiceFactory`

```csharp
public class BookingService
{
    const int BookingCacheIndex = 10;
    
    private readonly ICacheService _cacheService;
    public BookingService(ICacheServiceFactory cacheServiceFactory)
    {
        _cacheService = cacheServiceFactory.Resolve(BookingCacheIndex);
    }
    
    .. // Your implementation details 
}
```
