Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Disallow resolution of unregistered types #117

Open
marcwittke opened this issue Jul 31, 2021 · 1 comment
Open

Disallow resolution of unregistered types #117

marcwittke opened this issue Jul 31, 2021 · 1 comment
Assignees

Comments

@marcwittke
Copy link
Owner

// SimpleInjector 5 needs this to resolve controllers
            Container.Options.ResolveUnregisteredConcreteTypes = true;

remove this hack. In case of MVC Controllers this can be done easily by scanning for implementations of Controller(Base)

@marcwittke
Copy link
Owner Author

compositionRoot.Container.GetTypesToRegister<ControllerBase>(GetType().Assembly).ForAll(t => compositionRoot.Container.Register(t));

to do a quick auto registration of all controllers

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

No branches or pull requests

1 participant