Ejemplo n.º 1
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            var opt = new EventGridOptions();

            opt.AutoValidateSubscription = true;
            opt.AutoValidateSubscriptionAttemptNotifier = (url, success, message) => {
                Debug.WriteLine($"Validation attempt: {url} -> Success: {success}: {message}");
            };
            opt.EventsPath = "api/events";
            opt.MapEvent <SomeEventHandler>("someEventType");
            opt.MapEvent <NewCustomerEventHandler>("newCustomerEventType");
            opt.MapDefault <DefaultMappingHandler>();
            opt.SetValidationKey("key", "foo");
            app.UseEventGrid(opt);

            app.UseMvc();
        }