예제 #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);
        }
예제 #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)) ?? (() => { }));
        }
예제 #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));
        }
예제 #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) ?? (() => { }));
        }
예제 #5
0
 public void Configure(
     IApplicationBuilder app,
     IHostingEnvironment env,
     IApplicationEnvironment appEnvironment,
     IAppConfig webappconfig)
 {
     _appEnvironment = appEnvironment;
     AppSettings     = webappconfig.Get();
     app.UseIISPlatformHandler();
     app.UseStaticFiles();
     app.UseMvc();
 }
예제 #6
0
파일: Startup.cs 프로젝트: carlosap/CSharp
 public void Configure(IApplicationBuilder app, IHostingEnvironment env, IAppConfig webappconfig)
 {
     ServerPath  = env.ContentRootPath;
     AppSettings = webappconfig.Get();
     app.UseMvc();
 }