Custom Resolve method

Mar 21, 2010 at 1:58 PM

Hello! I have some overloaded Resolve method, which uses standard UnityContainer.Resolve method and some additional logic. The situation is similar to use of unity container in Prism. They have some UnityAdapter class, where overloaded methods could be defined. Then they register it as ServiceLocator. And I wonder, if it possible to force container use my custom Resolve method from this class instead of default method?
Thanks in advance!

Mar 22, 2010 at 4:40 PM

Your best bet would be to create a container extension with a custom ObjectBuilder strategy. Put it at the front of the strategy chain and implement your extra logic in the PostBuildup method. Then your extra logic will run on every resolve call through the existing resolve method.


Apr 5, 2010 at 5:58 AM

Thank You for your answer! Would You be so kind and give me an example of what I'm intended to do? Some template of code? There are so few examples of how to use object builder, so I'm just simply don't know where to start and will appreciate any help which could help me.

Thanks in advance!