/// <summary>
        ///     Builds the unity container.
        /// </summary>
        /// <returns></returns>
        private static IUnityContainer BuildUnityContainer()
        {
            // configure services
            var container = new UnityContainer();

            container.ConfigureServices(_perRequestManagerFactory);

            // override service registrations

            container.RegisterType <IAccountService, AccountServiceDecorator>(
                container.Decorate <IAccountService>(s => new AccountServiceDecorator(s, container.Resolve <IHubConnectionContext <dynamic> >())));

            container.RegisterType <IJournalService, JournalServiceDecorator>(
                container.Decorate <IJournalService>(s => new JournalServiceDecorator(s, container.Resolve <IHubConnectionContext <dynamic> >())));

            // configure app
            container.RegisterInstance(GlobalHost.ConnectionManager);
            container.RegisterHubContext <NotificationHub>();

            return(container);
        }