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);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…