// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IDispatcher dispatcher, IOptions <DomainDbConfiguration> settings) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.Run(async(context) => { // Create a sample product loading data from domain events. var product = await GettingStarted.CreateProduct(dispatcher); // Display product title. await context.Response.WriteAsync($"Product title: {product.Title}"); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IDispatcher dispatcher, EventStoreDbContext eventStoreDbContext) { // Ensure Weapsy.Cqrs database is installed. eventStoreDbContext.Database.Migrate(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.Run(async context => { // Create a sample product loading data from domain events. var product = await GettingStarted.CreateProduct(dispatcher); // Display product title. await context.Response.WriteAsync($"Product title: {product.Title}"); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IDispatcher dispatcher) { // Ensure Kledex database is installed. app.UseKledex().EnsureDomainDbCreated(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } // Create a sample product loading data from domain events. var product = GettingStarted.CreateProduct(dispatcher).GetAwaiter().GetResult(); app.Run(async context => { // Display product title. await context.Response.WriteAsync($"Product title: {product.Title}"); }); }