Exemplo n.º 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            app.LogDeployDate();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            EventDbContext.UpdateDatabase(app);

            app.UseMvc();

            app.AddMessageHandler <TestEvent, TestHandler>();

            var _firestoreDb = CommonFunctions.InitiFirestore(env);
            var query        = _firestoreDb.Collection(ConstantServices.OrderCollection)
                               //.WhereEqualTo("Status", (int)OrderStatus.New)
                               .WhereEqualTo(ConstantServices.ServiceC, false);
            var eve = new ListenNewOrder {
                ServeName = ConstantServices.ServiceC, CollectionName = ConstantServices.OrderCollection
            };

            app.AddFirestoreHandler <ListenNewOrder, FirestoreHandler>(eve, query);

            app.CheckEventRegistered(typeof(Startup).Namespace);
        }
Exemplo n.º 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            EventDbContext.UpdateDatabase(app);

            app.UseMvc();
        }