- Create a basic attribute called "RegisterType" that you could place on a class, The options I've found most useful are an enum to define it's lifetime manager and addtional type attributes to filter out types you don't want to register, IDisposable etc.
- Create an optional attribute that can be put in the assembly to indicate it should be scanned. This is optional but can be helpful for performance reasons.
- Create a Unity extension that reads all loaded types (I've found tricks for web applications here) and scans for this attribute and registers matching types.
According to various benchmarks unity is quite slow when comparing with other ioc containers like AutoFac, StructureMap or Castle Windsor. It would be nice if could you improve performance of unity container.31 votes
It would be nice to have write extension for Visual Studio providing in configuration file Intellisense. It should show types referenced by assembly that can be registered in container.18 votes
WebActivator is a great conventions for embedding hooks that get wired up in the assembly. The basic idea would be to allow for a static method in an assembly that would take a single IUnityContainer parameter and allow the developer to embed and extension/setup logic in there. This would help with NuGet packages that want to register items by default without configuration manipulation.13 votes
I want intercept internal types, but now I got error.
Can you make as FakeItEasy https://github.com/FakeItEasy/FakeItEasy/wiki/A-guide-for-faking-internal-(Friend)-types?9 votes
Optional<T> is a constructor parameter which is not an essential dependency of a class but can be needed for some actions. This is very helpfull if you have for example licence features in your application. You can than register on startup only components which are licensed and your other components can decide which parts to show or use based on the available features. Like nullable types it needs a HasValue or IsRegistred property to check if a type can be instanciated.
IEnumerable<T> is needed to get all registrations of a particular type.3 votes
- Don't see your idea?