Skip to content

How do I use this package together with dependency injection? #86

Description

@Stolpe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions