# 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 
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eiffel.dev/features/caching/usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
