Click here to Skip to main content
15,845,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I run into a problem using the unity container. I need more control over how the instances of registered types are created. I guess what I need to do is register a factory which will be responsible for instance creation. I found some samples on, but the code posted there does not work with the current version of Unity. Does anybody know how to achive that? Any advice will be appreciated.

Best regards,
Updated 23-Dec-10 2:35am
JF2015 23-Dec-10 7:35am    
Edited to fix the link.

1 solution

Can you describe what kind of control you are looking for and which version you are using?

If you are looking to create instance of child properties at will and not when the class is instantiated, all you need is to create a container object and call the resolve method whenever an instance should be created.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900