Пример #1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            DatabaseFactory.SetDatabaseProviderFactory(new DatabaseProviderFactory());

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            BusinessLogic.UnityConfig.InitContainer();

            ControllerBuilder.Current.SetControllerFactory(typeof(ArmedCards.Web.UnityControllerFactory));

            // Ensure ASP.NET Simple Membership is initialized only once per app start
            new ArmedCards.Authentication.DatabaseInitialize().Excute();

            AuthConfig.RegisterAuth();

            AS.ActiveConnection.Base.IDelete _deleteActiveConnection = BusinessLogic.UnityConfig.Container.Resolve <AS.ActiveConnection.Base.IDelete>();

            Entities.Filters.ActiveConnection.DeleteAll filter = new Entities.Filters.ActiveConnection.DeleteAll();
            _deleteActiveConnection.Execute(filter);
        }
Пример #2
0
        public void Disconnect()
        {
            AS.ActiveConnection.Base.IDelete _deleteConnection = BusinessLogic.UnityConfig.Container.Resolve <AS.ActiveConnection.Base.IDelete>();

            Entities.Filters.ActiveConnection.Delete filter = new Entities.Filters.ActiveConnection.Delete
            {
                ActiveConnectionID = Context.ConnectionId
            };

            Entities.ActiveConnection connection = _deleteConnection.Execute(filter);

            Clients.All.RemoveConnection(connection);
        }