Consider this example:
var host = Host
public interface ITest
public void Method();
public class Test : ITest
public void Method()
Technically, the interface `ITest` is being used, but from the developer's perspective it's not. It's being registered in the DI container and never retrieved from there, because `GetRequiredService` is commented out.
Is there a way to mark the type parameter on `AddSingleton` and similar methods so that it only counts as a "weak" usage?
This would mean that if we uncomment the line with `GetRequiredService`, the interface would be marked as used, but if we leave it commented, the interface would be marked as "not used" by the code analysis.
This would come handy for other scenarios as well, like test suites and so on, like suggested here: