-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ExcludeTypeFromAutoRegistration dosn't do anything for ChildContainers #299
Comments
I'll take a look this weekend but ultimately I believe what you're seeing is that auto registration is independent between container & child container. So the request bubble up to the root container where the auto registration resolves. |
I think same, but it's not expected behavior for me. Nested container must block such things and I've expected to see 5 in result |
If you want to make it works as I expect, than in subContainer you could register factory like this:
But it still wired that something dosn't work as intended |
It looks like childContainers broken completely. |
Essentially what you're seeing is that auto registration is done in the root container. I'll say up front that the child container support is not 100% compatible with what you'll see in other containers like Unity or AutoFac. Most of these decisions are rooted in the fact Grace use Linq expressions to build factories for performance but they don't take dynamic exports into consideration like child containers. |
Here is the code illustrating example. If I exclude AutoRegistration in child container (I want to override parent behaviour) it won't work. I need to exclude it in parent container.
So Excluding in child containers dosn't do anything.
The text was updated successfully, but these errors were encountered: