Hi,
I'm trying to get the autofac ILifetimeScope from a ConsumeContext in and IConsumeObserver or Filter. Based on other posts I hoped I could do somthing like this:
if (context.TryGetPayload<ILifetimeScope>(out var lifetimeScope))
{
... do something with the lifetimescope ...
}
But the context never contains the ILifetimeScope even though it was added to the payload of the ConsumeContext in the AutofacConsumerScopeProvider.
1) Can someone explain what's happening? Is this expected behavior?
2) I might have wrong assumptions about how the context is passed in the pipeline. Is their any doc/post/... available which explains the usage of the contexts?
Feedback highly appreciated!
Tim