[source,csharp]
----
class EnclosingType
{
    private readonly ILogger logger;

    public EnclosingType(ILoggerFactory loggerFactory)
    {
        logger = loggerFactory.CreateLogger<AnotherType>();   // Noncompliant
        logger = loggerFactory.CreateLogger<EnclosingType>(); // Compliant
    }
}
----
