INJ0008 and INJ0012 detect UseProxyFactory and Factory when an open generic is written explicitly as an unbound ServiceType, but they miss equivalent registrations inferred from the attributed generic class and its registration strategy.
For example, a generic class using ImplementedInterfaces or an assembly-wide default can still describe an open-generic registration without spelling ServiceType = typeof(...). With UseProxyFactory = true or Factory = nameof(...), the generator drops the registration, but neither diagnostic fires.
Expected: determine whether the resulting descriptor is open after applying RegistrationStrategy and defaults, then report INJ0008 or INJ0012 consistently before generation drops it.
Please cover both per-attribute and assembly-default strategies.
Found while addressing review feedback on the documentation-site rewrite.
INJ0008 and INJ0012 detect
UseProxyFactoryandFactorywhen an open generic is written explicitly as an unboundServiceType, but they miss equivalent registrations inferred from the attributed generic class and its registration strategy.For example, a generic class using
ImplementedInterfacesor an assembly-wide default can still describe an open-generic registration without spellingServiceType = typeof(...). WithUseProxyFactory = trueorFactory = nameof(...), the generator drops the registration, but neither diagnostic fires.Expected: determine whether the resulting descriptor is open after applying
RegistrationStrategyand defaults, then report INJ0008 or INJ0012 consistently before generation drops it.Please cover both per-attribute and assembly-default strategies.
Found while addressing review feedback on the documentation-site rewrite.