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