Example #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);
        }
Example #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)) ?? (() => { }));
        }
Example #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));
        }
Example #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) ?? (() => { }));
        }
Example #5
0
 public void Configure(
     IApplicationBuilder app,
     IHostingEnvironment env,
     IApplicationEnvironment appEnvironment,
     IAppConfig webappconfig)
 {
     _appEnvironment = appEnvironment;
     AppSettings     = webappconfig.Get();
     app.UseIISPlatformHandler();
     app.UseStaticFiles();
     app.UseMvc();
 }
Example #6
0
 public void Configure(IApplicationBuilder app, IHostingEnvironment env, IAppConfig webappconfig)
 {
     ServerPath  = env.ContentRootPath;
     AppSettings = webappconfig.Get();
     app.UseMvc();
 }