Exemplo n.º 1
0
        public static void ResolveMappers()
        {
            MongoMapping.Mapper();

            FluentMapper.Initialize(config =>
            {
                config.AddMap(new SqlMapping());
            });
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
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();
                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();
        }