Skip to content

Modify DI to inject service interface instead of implementation #53

@BastienPerdriau

Description

@BastienPerdriau

Hello,

I'm wondering if it could be possible to inject the ILogAnalyticsClient interface instead of LogAnalyticsClient class ?

By replacing

services.AddHttpClient<LogAnalyticsClient>();

by

services.AddHttpClient<ILogAnalyticsClient, LogAnalyticsClient>();

I think it would make a breaking change when getting LogAnalyticsClient in services constructor but it would be more easier to mock services in tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions