public BookAppService(IHybridCache<BookCacheItem> hybridCache)
{
_bookRepository = bookRepository;
_hybridCache = hybridCache;
}
@ -93,6 +86,13 @@ public class BookAppService : IBookAppService, ITransientDependency
});
}
}
public class BookCacheItem
{
public string Name { get; set; }
public int PageCount { get; set; }
}
```
* You can use the `IHybridCache<TCacheItem>` or `IHybridCache<TCacheItem, TCacheKey>` service to leverage the hybrid caching. If you use `IHybridCache<TCacheItem>`as the service, then you should pass the cache key as *string* like in the example above.