How can I make Unity not to throw ResolutionFailedException
if Resolve
fails?
Is there something like TryResolve<IMyInterface>
?
var container = new UnityContainer();
var foo = container.TryResolve<IFoo>();
Assert.IsNull(foo);
Also note that, if you're using Unity 2.0 you can use the new IsRegistered() method and it's generic version as well.