Esempio n. 1
0
        public void GetPipelineFromAppConfig()
        {
            var configuration = ConfigurationManager.OpenMappedExeConfiguration(new ExeConfigurationFileMap
            {
                ExeConfigFilename = "app.config"
            }, ConfigurationUserLevel.None);
            var pipeline1 = DbEntityPipeline.GetPipelineFromAppConfig(configuration.ConnectionStrings.ConnectionStrings["DataConnection"]);

            Assert.True(pipeline1 is MySqlEntityPipeline);

            var pipeline2 = DbEntityPipeline.GetPipelineFromAppConfig(configuration.ConnectionStrings.ConnectionStrings["SqlServerDataConnection"]);

            Assert.True(pipeline2 is SqlServerEntityPipeline);

            var pipeline3 = DbEntityPipeline.GetPipelineFromAppConfig(configuration.ConnectionStrings.ConnectionStrings["MongoDbDataConnection"]);

            Assert.True(pipeline3 is MongoDbEntityPipeline);
        }
Esempio n. 2
0
 /// <summary>
 /// Get the default pipeline when user forget set a Pipeline to spider.
 /// </summary>
 /// <returns>数据管道</returns>
 protected override IPipeline GetDefaultPipeline()
 {
     return(DbEntityPipeline.GetPipelineFromAppConfig());
 }