static void Main(string[] args) { MongoMapping.Configure(); Console.Write("Source: "); var sourceConnection = Console.ReadLine(); Console.Write("Target: "); var targetConnection = Console.ReadLine(); var source = GetDb(sourceConnection); var target = GetDb(targetConnection); var handler = new CopyContentCommandHandler(source, target); ((IRequestHandler <CopyContentCommand, Unit>)handler).Handle(new CopyContentCommand(), CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult(); }
// 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(); app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = true, ReactHotModuleReplacement = true }); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "DMWorkshop V1"); }); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); routes.MapSpaFallbackRoute( name: "spa-fallback", defaults: new { controller = "Home", action = "Index" }); }); MongoMapping.Configure(); }