RegisterType being built when requested.

Nov 23, 2010 at 9:23 AM

I have a container that has a whole slew of registered types. Some of these types also have dependencies. However, when one of these types is instantiated is it possible for unity to also build it up? I could put a call in the constructor to Buildup but can it happen automagically. How about a RegisterTypeWithBuildup?

Ron.

Nov 23, 2010 at 9:27 AM

When you resolve an instance of a type from a unity container, it automatically creates its dependencies as long as the dependencies are also configured in the container.  The BuildUp is there in cases where you don't have the option to create the object itself such as asp.net pages. 

Does this answer your concern or did I misunderstand your question?

Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com