Skip to content

Conversation

stefanmoser
Copy link

This is an implementation of UnregisterMultiple. The main reason this is needed is that RegisterMultiple uses a convention to register each type as a named type with the full name of the type. Therefore if you had previous registered a type using...

container.RegisterMultiple<TInterface>(new [] { type });

...you would then have to unregister the type using...

container.Unregister<TInterface>(type.FullName);

This is a little unintuitive. This PR allows you to unregister the type using...

container.UnregisterMultiple<TInterface>(new [] { type });

...which is the same syntax that the type was originally registered.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unsure about including the commented out #if NETFX_CORE. This code was copied from the implementation of public MultiRegisterOptions RegisterMultiple(Type registrationType, IEnumerable<Type> implementationTypes) so I left it in for consistency.

@niemyjski
Copy link
Collaborator

Could you please resolve the merge conflicts and well get this merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants