I have a project where I use Autofac to create UI components.
I would like some of my Autofac-created UI components to have child components that can potentially reference their parent.
What is the right way of doing this such that Autofac-specifics don’t leak into my application? Ideally, I’d like a way of basically saying:
<code>Create a new scope that inherits all items in the current scope and registers A, B, and C.
From that new scope, create A.
</code>
<code>Create a new scope that inherits all items in the current scope and registers A, B, and C.
From that new scope, create A.
</code>
Create a new scope that inherits all items in the current scope and registers A, B, and C.
From that new scope, create A.
Any ideas?
(I’d would like to avoid making my components aware of autofac things. If I could create a Func<???>
that would handle all this, that would be awesome.