Ejemplo n.º 1
0
        public AppBootstrapper(IContainer testContainer = null)
        {
            _logger = NLog.LogManager.GetCurrentClassLogger();

            OnStartUp = Observable.Create <ILifetimeScope>(observer =>
            {
                try
                {
                    var container         = testContainer ?? CreateRootContainer();
                    _configServiceLocator = new UseAutofacServiceLocator(container);
                    var d = new CompositeDisposable(RootSubscriptions(container));

                    observer.OnNext(container);
                    return(d);
                }
                catch (Exception ex)
                {
                    observer.OnError(ex);
                    return(Disposable.Empty);
                }
            });
        }
Ejemplo n.º 2
0
        public AppBootstrapper(IContainer testContainer = null)
        {
            _logger = NLog.LogManager.GetCurrentClassLogger();

            OnStartUp = Observable.Create<ILifetimeScope>(observer =>
            {
                try
                {
                    var container = testContainer ?? CreateRootContainer();
                    _configServiceLocator = new UseAutofacServiceLocator(container);
                    var d = new CompositeDisposable(RootSubscriptions(container));

                    observer.OnNext(container);
                    return d;
                }
                catch (Exception ex)
                {
                    observer.OnError(ex);
                    return Disposable.Empty;
                }
            });
        }