Ejemplo n.º 1
0
        public QueryFactory GetSource(string synchronizationSet)
        {
            var config = _config.Get().SynchronizationSets.Single(x => x.Name == synchronizationSet);

            var connection = new SqlConnection(config.Source.ConnectionString);

            connection.Open();
            var compiler = new SqlServerCompiler();

            compiler.UseLegacyPagination = false;
            var queryFactory = new QueryFactory(connection, compiler);

            queryFactory.QueryTimeout = config.Source.Timeout ?? 30;
            return(queryFactory);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get AppRunner from <para>appConfig</para> using AppRunner predefined key
        /// </summary>
        /// <param name="appConfig">AppConfig instance</param>
        /// <returns>delegate of Action type, always not null</returns>
        public static Action GetAppRunner(this IAppConfig appConfig)
        {
            if (appConfig == null)
            {
                throw new ArgumentNullException(nameof(appConfig));
            }

            return((appConfig.Get <Action>(AppRunnerKey)) ?? (() => { }));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get Config Variables from <para>appConfig</para> using ConfigVariables predefined key
        /// </summary>
        /// <param name="appConfig">AppConfig instance</param>
        /// <returns>IConfigVariables instance</returns>
        public static IConfigVariables GetConfigVariables(this IAppConfig appConfig)
        {
            if (appConfig == null)
            {
                throw new ArgumentNullException(nameof(appConfig));
            }

            return(appConfig.Get <IConfigVariables>(ConfigVariablesKey));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Get AppRunner from <para>appConfig</para> using AppRunner predefined key
        /// </summary>
        /// <param name="appConfig">AppConfig instance</param>
        /// <returns>delegate of Action type, always not null</returns>
        public static Action GetPostSetupAction(this IAppConfig appConfig)
        {
            if (appConfig == null)
            {
                throw new ArgumentNullException(nameof(appConfig));
            }

            return(appConfig.Get <Action>(AppPostSetupKey) ?? (() => { }));
        }
Ejemplo n.º 5
0
 public void Configure(
     IApplicationBuilder app,
     IHostingEnvironment env,
     IApplicationEnvironment appEnvironment,
     IAppConfig webappconfig)
 {
     _appEnvironment = appEnvironment;
     AppSettings     = webappconfig.Get();
     app.UseIISPlatformHandler();
     app.UseStaticFiles();
     app.UseMvc();
 }
Ejemplo n.º 6
0
 public void Configure(IApplicationBuilder app, IHostingEnvironment env, IAppConfig webappconfig)
 {
     ServerPath  = env.ContentRootPath;
     AppSettings = webappconfig.Get();
     app.UseMvc();
 }