Skip to content

New rule - Detect inconsistency between containing class and ILogger type parameter #940

@Thieum

Description

@Thieum

Is your feature request related to a problem? Please describe.
An inconsistency between a class, and an ILogger parameter of a constructor of this class can exist without any error or warning:

using  Microsoft.Extensions.Logging; 

class A(ILogger<B> logger)
{
}

Describe the solution you'd like
I would like this case to be detected by a new rule, and that a fix is provided to set the type for the ILogger to A instead of B.

Describe alternatives you've considered
I didn't find any alternatives so far (existing rule)

Additional context
N/A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions