Beispiel #1
0
        public ConnectedProjectionsManager(
            IMigrationHelper migrationHelper,
            IRegisteredProjections registeredProjections,
            IConnectedProjectionsCommandBus commandBus,
            IConnectedProjectionsCommandBusHandlerConfiguration commandBusHandlerConfiguration,
            IConnectedProjectionsCommandHandler commandHandler)
        {
            _registeredProjections = registeredProjections ?? throw new ArgumentNullException(nameof(registeredProjections));
            _commandBus            = commandBus ?? throw new ArgumentNullException(nameof(commandBus));

            if (commandBusHandlerConfiguration == null)
            {
                throw new ArgumentNullException(nameof(commandBusHandlerConfiguration));
            }

            if (commandHandler == null)
            {
                throw new ArgumentNullException(nameof(commandHandler));
            }

            if (migrationHelper == null)
            {
                throw new ArgumentNullException(nameof(migrationHelper));
            }

            commandBusHandlerConfiguration.Register(commandHandler);

            migrationHelper.RunMigrations();
        }
 internal Migrator(
     IFieldMigratorConfiguration configuration,
     IMigrationHelper migrationHelper)
 {
     _configuration   = configuration;
     _migrationHelper = migrationHelper;
 }
Beispiel #3
0
        /// <summary>
        /// Constructor which creates the json configuration for the import and also a request service for the grabing the remote html
        /// </summary>
        /// <param name="options"></param>
        /// <param name="helper"></param>
        /// <param name="content"></param>
        /// <param name="request"></param>
        public ImporterService(MigrationOptions options, IMigrationHelper helper, IMigrationContentService content, IRequestService request)
        {
            Options = options.NotNull();

            _helper = helper.NotNull();
            _content = content.NotNull();
            _request = request.NotNull();
        }
Beispiel #4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IMigrationHelper migrationService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            //app.UseHttpsRedirection();
            app.UseAuthentication();
            app.UseMvc();

            migrationService.RunMigrationUp();
        }
 public EmbedLinkMigrator(IMigrationHelper helper)
     : base(helper)
 {
 }
 public MigrationRunner(IMigrationHelper migrationHelper)
 {
     _migrationHelper = migrationHelper;
 }
Beispiel #7
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMigrationHelper migrationHelper)
        {
            var debugValue     = Configuration.GetSection("Logging:Loglevel:Default").Value;
            var logLevelParsed = (LogLevel)Enum.Parse(typeof(LogLevel), debugValue);

            // I'm gonna leave it as string array becase we might want to add some log modules later
            string[] logOnlyThese = { }; // or reverse string[] dontlong = {"ObjectResultExecutor", "JsonResultExecutor"};

            loggerFactory.AddDebug((category, logLevel) => !logOnlyThese.Any(category.Contains) && logLevel >= logLevelParsed);

            migrationHelper.Migrate();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseMiniProfiler();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();
            app.UseSession();

            app.UseWebSockets();

            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                CookieName            = CookieAuthenticationDefaults.AuthenticationScheme,
                AuthenticationScheme  = CookieAuthenticationDefaults.AuthenticationScheme,
                LoginPath             = new PathString("/Auth/SignIn"),
                AccessDeniedPath      = new PathString("/Home/AccessDenied"),
                AutomaticAuthenticate = true,
                AutomaticChallenge    = true
            });

            app.UseSignalR();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            var scheduler = ShedulerCreator.CreateScheduler(app);

            scheduler.Start().Wait();
        }
 public AccountContentMigrator(IMigrationHelper helper)
     : base(helper)
 {
 }
 void SetupTests(object sender, EventArgs e)
 {
     _iMigrationHelper = Mock.StrictMock<IMigrationHelper>().OverloadFactory();
     _iFileIo = Mock.StrictMock<IFileIO>().OverloadFactory();
 }
 public RenderingsMigrator(IMigrationHelper helper)
 {
     this.Helper = helper;
 }
Beispiel #11
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMigrationHelper migrationHelper)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();

                app.UseBrowserLink();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseSession();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
            migrationHelper.Migrate();
        }
 public RenderingsMigrator(IMigrationHelper helper)
     : base(helper)
 {
 }
 void SetupCrap(object sender, EventArgs e)
 {
     _migrationHelper = Mock.DynamicMock<IMigrationHelper>().OverloadFactory();
     _fileIo = Mock.DynamicMock<IFileIO>().OverloadFactory();
 }
 internal protected ProcessMedia(IMigrationHelper migrationHelper)
 {
     _migrationHelper = migrationHelper;
 }
 public AccountContentMigrator(IMigrationHelper helper)
 {
     this.Helper = helper;
 }
 public EmbedHtmlMigrator(IMigrationHelper helper)
 {
     this.Helper = helper;
 }
Beispiel #17
0
 /// <inheritdoc />
 public Migrator(Type baseTypeOfMigrations, Func <Type, IMigrationHelper> migrationHelperFactory)
 {
     this.baseTypeOfMigrations = baseTypeOfMigrations;
     this.migrationHelper      = migrationHelperFactory(baseTypeOfMigrations) ?? throw new ArgumentNullException(nameof(migrationHelper));
     this.migrations           = GetMigrationsFromCurrentAppDomain(baseTypeOfMigrations);
 }
 public EmbedHtmlMigrator(IMigrationHelper helper)
     : base(helper)
 {
 }
Beispiel #19
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IMigrationHelper migrationHelper)
        {
            string debugValue = Configuration.GetSection("Logging:Loglevel:Default").Value;
            var    logLevel   = (LogLevel)Enum.Parse(typeof(LogLevel), debugValue);

            //I'm gonna leave it as string array becase we might want to add some log modules later
            string[] logOnlyThese = { "WebHost" }; // or reverse string[] dontLog = {"ObjectResultExecutor", "JsonResultExecutor"};

            loggerFactory.AddDebug((category, _logLevel) => (logOnlyThese.Any(category.Contains) && _logLevel >= logLevel));

            var authHelper = new JwtAuthorizeHelper();

            authHelper.Configure(app);

            app.UseMvc();

            migrationHelper.Migrate();

            app.UseCors("AnyOrigin");
        }