Given two class A and B where B depends on A (constructor injected); B is registered as SingleInstance in the base container, and it is built. A is registered in a MultiTenantContainer as SingleInstance, varying on the tenantId.
Question 1: will
Resolve<B>()
recognize that B must also vary on tenantId?
Question 2: same, but A is registered as lifetime-scoped within the multi-tenant container and B is dependent on
Func<Owned<A>>.
Update: closure!
This was a case of "what I really wanted was..." because of my beginner's lack of understanding of the semantics; specifically, I needed instances that were built/shared across all resolutions within a tenant lifetime scope, which did not exist. Got some guidance, submitted a patch on issue #318, it was pulled into the trunk on changeset 752, and we're good to go! Now the question above would read:
Given two class A and B where B depends on A (constructor injected); B is registered as InstancePerTenant in the base container, and it is built. A is registered in a MultiTenantContainer as InstancePerTenant, varying on the tenantId...
and the answer to both questions is now "yes".
Thanks Travis and Nick for your help and maintaining this great tool.