khellang/Scrutor

Question: could we decorate the `IServiceScopeFactory`

WeihanLi opened this issue · 2 comments

I'm trying to create a trace id for each scope resolved, while the IServiceScopeFactory is registered when BuildServiceProvider, is it possible to decorate the IServiceScopeFactory?

Hello @WeihanLi! 👋

The decorating code requires an existing registration be present when decorating. If IServiceScopeFactory isn't registered before building, it won't work. I didn't even know there was a registration for IServiceScopeFactory 😅