Azure / Azure/Microsoft.Azure.StackExchangeRedis

How do I use this package together with dependency injection?

Open
#86 9 comments 2 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
21
Forks
24
PR merge metrics
No merged PRs in 30d

Description

Hi,

This is more a question than an issue, but I struggle with understanding how I should use this package together with the Microsoft.Extensions family of nugets for bootstrapping.

My main issue is that the `AzureCacheForRedis.ConfigureForAzure*` methods are all asynchronous, while the overloads of `ConfigureServices()`, `AddSingleton()` etc are all synchronous. Am I supposed to do `.GetAwaiter().GetResult()`? This is an anti-pattern that I do the utmost to avoid unless the documentation explicitly tells me to do so.

The sample file "cheats" by just being a top-level Program.cs file where none of these real-world constraints exist.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.