示例#1
0
        protected void Application_Start()
        {
            var cs = ConnectionSettings.Create();

            var endpoint = new IPEndPoint(IPAddress.Loopback, 1113);
            var con      = EventStoreConnection.Create(endpoint);

            con.ConnectAsync();

            var credentials = new EventStore.ClientAPI.SystemData.UserCredentials("admin", "changeit");

            var adapter = new EventStoreAdapter(endpoint, credentials);

            ProjectionManager = new ProjectionManager(endpoint, credentials, adapter);
            ProjectionManager.Run();

            CommandManager = new CommandManager(con);

            //var binder = new DefaultModelBinder();
            //ModelBinders.Binders.Add(typeof(DateTime), binder);
            //ModelBinders.Binders.Add(typeof(DateTime?), binder);

            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }