public virtual bool TryResolve(Type serviceType, IContainer scope, out object instance) { if (scope == null) { //no scope specified scope = Scope(); } if (scope.IsRegistered(serviceType)) { instance = scope.Resolve(serviceType); return(true); } else { instance = SiteHelper.GetDefaultValue(serviceType); return(false); } }