No GetService won't throw.


On 29.05.2013, at 17:28, "Phil Haack" <notifications@github.com> wrote:

> In ReactiveUI/Logging.cs:
> 
> > @@ -106,7 +106,8 @@ public DefaultLogManager(IDependencyResolver dependencyResolver = null)
> >              dependencyResolver = dependencyResolver ?? RxApp.DependencyResolver;
> >  
> >              loggerCache = new MemoizingMRUCache<Type, IFullLogger>((type, _) => {
> > -                var ret = dependencyResolver.GetService<ILogger>();
> So the contract for most dependency injection frameworks I've used is that if the requested type does not exist, they throw an exception. This usually prevents the need to check for null.
> 
> So wouldn't a try/catch be necessary here?
> 
> —
> Reply to this email directly or view it on GitHub.