Пример #1
0
        private static void Run()
        {
            var redishost = ConfigurationManagerExtensions.GetConnectionString("RedisConnectionString");

            RedisServices.Init(redishost, null, string.Empty);

            CommandsAndEventsRegisterEngine.AutoRegister();

            EngineeCommandWorkerQueue.Start();
            EngineeEventWorkerQueue.Start();
            var cmd = (Console.ReadLine() ?? string.Empty).ToLower().Trim();

            while (!cmd.Equals("quit"))
            {
                switch (cmd)
                {
                case "quit":
                    _stop = true;
                    break;

                case "stop":
                    _stop = true;
                    break;

                case "start":
                    _stop = false;
                    MessiveSendCmd(null);
                    break;

                case "pubsub":
                    CommandEventSender.Send(new SampleEventCreated()
                    {
                        PublishedEventId = Guid.NewGuid(),
                        SampleVersion    = DateTime.Now.ToString(),
                        Version          = 0
                    });
                    break;

                case "pubsubmad":
                    _stop = false;
                    MessiveSendCmd(() => {
                        CommandEventSender.Send(new SampleEventCreated()
                        {
                            PublishedEventId = Guid.NewGuid(),
                            SampleVersion    = DateTime.Now.ToString(),
                            Version          = 0
                        });
                    });
                    break;
                }
                cmd = (Console.ReadLine() ?? string.Empty).ToLower().Trim();
            }

            Console.Read();
        }
Пример #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors();
            services.AddMvc(option => {
                // option.Filters.Add(new IotHubAuthorizeAttribute());
            }).SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            //RedisServices.Init("172.16.10.166", null, string.Empty);
            var redishost = ConfigurationManagerExtensions.GetConnectionString("RedisConnectionString");

            RedisServices.Init(redishost, null, string.Empty);
            CommandsAndEventsRegisterEngine.AutoRegister();

            EngineeCommandWorkerQueue.Start();
            EngineeEventWorkerQueue.Start();

            services.AddSwagger();
        }
 public SampleDbContext()
     : base(ConfigurationManagerExtensions.GetConnectionString("SampleDbContext"))
 {
 }
 public AllInOneDbContext() : base(ConfigurationManagerExtensions.GetConnectionString("AllInOneDbContext"))
 {
 }
 public EventSourcingDbContext()
     : base(ConfigurationManagerExtensions.GetConnectionString("EventSourcingDbContext"))
 {
 }
Пример #6
0
 public UserDomainDbContext(string connectionString)
     : base(ConfigurationManagerExtensions.GetConnectionString("UserDomainDbContext"))
 {
 }
 public ProjectSampleDatabase()
     : base(ConfigurationManagerExtensions.GetConnectionString("ProjectSampleDatabase"))
 {
 }
 public CommandEventStorageDbContext() 
     : base(ConfigurationManagerExtensions.GetConnectionString("CommandEventStorageDbContext"))
 {
 }
Пример #9
0
 public AuthenticateDbContext(string connectionString)
     : base(ConfigurationManagerExtensions.GetConnectionString("AuthenticateDbContext"))
 {
 }