internal static DbProviderServices GetProviderServices(DbProviderFactory factory) { EDesignUtil.CheckArgumentNull(factory, "factory"); // Special case SQL client so that it will work with System.Data from .NET 4.0 even without // a binding redirect. if (factory is SqlClientFactory) { return SqlProviderServices.Instance; } IServiceProvider serviceProvider = factory as IServiceProvider; if (serviceProvider == null) { throw MetadataUtil.ProviderIncompatible(System.Data.Entity.Design.Strings.EntityClient_DoesNotImplementIServiceProvider( factory.GetType().ToString())); } DbProviderServices providerServices = serviceProvider.GetService(typeof(DbProviderServices)) as DbProviderServices; if (providerServices == null) { throw MetadataUtil.ProviderIncompatible( System.Data.Entity.Design.Strings.EntityClient_ReturnedNullOnProviderMethod( "GetService", factory.GetType().ToString())); } return providerServices; }
public InvariantNameResolver(DbProviderFactory providerFactory, string invariantName) { DebugCheck.NotNull(providerFactory); DebugCheck.NotEmpty(invariantName); _invariantName = new ProviderInvariantName(invariantName); _providerFactoryType = providerFactory.GetType(); }
public DatabaseDriver(string driverName, DbProviderFactory factory) { Contract.Requires(!String.IsNullOrEmpty(driverName)); Contract.Requires(factory != null); this.Factory = factory; var name = factory.GetType().FullName; this.Type = name.Substring(0,name.LastIndexOf('.')); this.Name = driverName; }
public void GetFactoryWithDbConnectionTest() { ClearRegisteredFactories(); RegisterSqlClientAndTestRegistration(() => DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory))); DbProviderFactory factory = DbProviderFactories.GetFactory(new System.Data.SqlClient.SqlConnection()); Assert.NotNull(factory); Assert.Equal(typeof(System.Data.SqlClient.SqlClientFactory), factory.GetType()); Assert.Equal(System.Data.SqlClient.SqlClientFactory.Instance, factory); }
/// <summary> /// 获取数据库类型 /// </summary> /// <param name="dbProvider">数据库提供者</param> /// <param name="connectionString">数据库连接字符串</param> /// <returns>数据库类型</returns> internal static DatabaseType InternalGetDatabaseType(DbProviderFactory dbProvider, String connectionString) { String providerName = dbProvider.GetType().ToString().ToLowerInvariant(); DatabaseType dataType = DatabaseType.Unknown; foreach (KeyValuePair<String, DatabaseType> pair in _typeDict) { if (providerName.IndexOf(pair.Key) >= 0) { dataType = pair.Value; break; } } if (dataType != DatabaseType.Unknown) { return dataType; } #region Access if (providerName.IndexOf("system.data.oledb") >= 0) { String dataSource = ""; String[] parameters = connectionString.Replace(" ", "").ToLowerInvariant().Split(';'); if (parameters != null && parameters.Length > 0) { Int32 dataSourcePos = -1; for (Int32 i = 0; i < parameters.Length; i++) { dataSourcePos = parameters[i].IndexOf("datasource"); if (dataSourcePos > -1) { dataSource = parameters[i]; break; } } } if (dataSource.IndexOf(".mdb") > -1) { return DatabaseType.Access; } else if (dataSource.IndexOf(".accdb") > -1) { return DatabaseType.Access; } } #endregion return DatabaseType.Unknown; }
public void ReplaceFactoryWithRegisterFactoryWithTypeTest() { ClearRegisteredFactories(); RegisterSqlClientAndTestRegistration(() => DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(System.Data.SqlClient.SqlClientFactory))); DbProviderFactories.RegisterFactory("System.Data.SqlClient", typeof(TestProviderFactory)); DataTable providerTable = DbProviderFactories.GetFactoryClasses(); Assert.Equal(1, providerTable.Rows.Count); DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.SqlClient"); Assert.NotNull(factory); Assert.Equal(typeof(TestProviderFactory), factory.GetType()); Assert.Equal(TestProviderFactory.Instance, factory); }
/// <summary> /// Makes sure that the given <paramref name="dbProviderFactory"/> is registered inside global <see cref="DbProviderFactories"/>. /// It queries the needed information from the runtime type and creates a new entry inside <c>system.data</c> configuration section. /// Additionally the path of the factory is added to <see cref="AppDomain.CurrentDomain"/> as "PrivatePath" to allow /// proper assembly lookup inside subfolder. /// </summary> /// <param name="dbProviderFactory">DbProviderFactory instance</param> public static void AssureKnownFactory(DbProviderFactory dbProviderFactory) { var dataSet = ConfigurationManager.GetSection("system.data") as DataSet; if (dataSet == null) return; Type factoryType = dbProviderFactory.GetType(); string invariantName = factoryType.Namespace; DataTable dt = dataSet.Tables[0]; if (dt.Rows.Cast<DataRow>().Any(row => row["InvariantName"].ToString() == invariantName)) return; dt.Rows.Add(invariantName, "Temporary added factory for EF use", invariantName, factoryType.AssemblyQualifiedName); AppDomain.CurrentDomain.AppendPrivatePath(Path.GetDirectoryName(factoryType.Assembly.Location)); }
private void RegisterSqlClientAndTestRegistration(Action registrationFunc) { Assert.NotNull(registrationFunc); Assert.Throws <ArgumentException>(() => DbProviderFactories.GetFactory("System.Data.SqlClient")); DataTable providerTable = DbProviderFactories.GetFactoryClasses(); Assert.Equal(0, providerTable.Rows.Count); registrationFunc(); providerTable = DbProviderFactories.GetFactoryClasses(); Assert.Equal(1, providerTable.Rows.Count); DbProviderFactory factory = DbProviderFactories.GetFactory(providerTable.Rows[0]); Assert.NotNull(factory); Assert.Equal(typeof(System.Data.SqlClient.SqlClientFactory), factory.GetType()); Assert.Equal(System.Data.SqlClient.SqlClientFactory.Instance, factory); }
/// <summary> /// Create an IDbFactory based on a DbProviderFactory. /// </summary> /// <param name="providerFactory">A DbProviderFactory as returned from DbProviderFactories.GetFactory()</param> /// <returns>An object implementing IDbFactory for the provider requested.</returns> /// <exception cref="DatabaseException"></exception> /// <exception cref="ArgumentNullException"></exception> public static IDbFactory CreateDbFactory(DbProviderFactory providerFactory) { if (providerFactory == null) throw new ArgumentNullException("providerFactory"); IDbFactory dbFactory; if (providerFactory is System.Data.SqlClient.SqlClientFactory) dbFactory = new SqlClientDbFactory(providerFactory as System.Data.SqlClient.SqlClientFactory); //else if (providerFactory is System.Data.Odbc.OdbcFactory) // dbFactory = new DbFactoryOdbc(providerFactory as System.Data.Odbc.OdbcFactory); //else if (providerFactory is System.Data.OleDb.OleDbFactory) // dbFactory = new DbFactoryOleDb(providerFactory as System.Data.OleDb.OleDbFactory); else throw new DataException("DbFactoryMaker has no support for DbProviderFactory of type " + providerFactory.GetType().FullName); return dbFactory; }
public DynamicModel(string connectionStringName = "", string tableName = "", string primaryKeyField = "") { TableName = tableName == "" ? this.GetType().Name : tableName; PrimaryKeyField = string.IsNullOrEmpty(primaryKeyField) ? "ID" : primaryKeyField; if (connectionStringName == "") connectionStringName = ConfigurationManager.ConnectionStrings[0].Name; var _providerName = "System.Data.SqlClient"; if (ConfigurationManager.ConnectionStrings[connectionStringName] != null) { if (!string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[connectionStringName].ProviderName)) _providerName = ConfigurationManager.ConnectionStrings[connectionStringName].ProviderName; } else { throw new InvalidOperationException("Can't find a connection string with the name '" + connectionStringName + "'"); } _factory = DbProviderFactories.GetFactory(_providerName); _connectionString = ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString; _prefix = _factory.GetType().FullName.Contains("Oracle") ? ":" : "@"; }
public OracleTimestampConverter(DbProviderFactory factory) { OracleAssembly = factory.GetType().Assembly; var globalizationType = OracleAssembly.GetType("Oracle.DataAccess.Client.OracleGlobalization"); if (globalizationType != null) { DateTimeOffsetInputFormat = DateTimeOffsetOutputFormat = "yyyy-MM-dd HH:mm:ss.ffffff zzz"; TimestampTzFormat = "YYYY-MM-DD HH24:MI:SS.FF6 TZH:TZM"; SetThreadInfoArgs = new [] {globalizationType.InvokeMember("GetClientInfo", InvokeStaticPublic, null, null, null)}; const BindingFlags setProperty = BindingFlags.Public | BindingFlags.SetProperty | BindingFlags.Instance; globalizationType.InvokeMember("TimeStampTZFormat", setProperty, null, SetThreadInfoArgs[0], new object[] { TimestampTzFormat }); SetThreadInfo = globalizationType.GetMethod("SetThreadInfo", BindingFlags.Public | BindingFlags.Static); var parameterType = OracleAssembly.GetType("Oracle.DataAccess.Client.OracleParameter"); var oracleDbTypeProperty = parameterType.GetProperty("OracleDbType", BindingFlags.Public | BindingFlags.Instance); SetOracleDbType = oracleDbTypeProperty.GetSetMethod(); var oracleDbType = OracleAssembly.GetType("Oracle.DataAccess.Client.OracleDbType"); SetOracleDbTypeArgs = new [] {Enum.Parse(oracleDbType, "TimeStampTZ")}; var readerType = OracleAssembly.GetType("Oracle.DataAccess.Client.OracleDataReader"); GetOracleValue = readerType.GetMethod("GetOracleValue", BindingFlags.Public | BindingFlags.Instance); } else { //TODO This is Microsoft provider support and it does not handle the offsets correctly, // but I don't know how to make it work. DateTimeOffsetOutputFormat = "dd-MMM-yy hh:mm:ss.fff tt"; DateTimeOffsetInputFormat = "dd-MMM-yy hh:mm:ss tt"; TimestampTzFormat = "DD-MON-RR HH.MI.SSXFF AM"; // var parameterType = OracleAssembly.GetType("System.Data.OracleClient.OracleParameter"); // var oracleTypeProperty = parameterType.GetProperty("OracleType", BindingFlags.Public | BindingFlags.Instance); // SetOracleDbType = oracleTypeProperty.GetSetMethod(); var oracleDbType = OracleAssembly.GetType("System.Data.OracleClient.OracleType"); SetOracleDbTypeArgs = new [] {Enum.Parse(oracleDbType, "TimestampWithTZ")}; // var readerType = OracleAssembly.GetType("System.Data.OracleClient.OracleDataReader"); // GetOracleValue = readerType.GetMethod("GetOracleValue", BindingFlags.Public | BindingFlags.Instance); } }
/// <summary> /// 获取数据库类型 /// </summary> /// <param name="connectionString">数据库连接字符串</param> /// <param name="dbProvider">数据库提供者</param> /// <returns>数据库类型</returns> internal static DatabaseType InternalGetDatabaseType(String connectionString, DbProviderFactory dbProvider) { String providerName = dbProvider.GetType().ToString().ToLowerInvariant(); #region SqlServer if (providerName.IndexOf("system.data.sqlclient") >= 0) { return DatabaseType.SqlServer; } #endregion #region MySQL if (providerName.IndexOf("mysql.data.mysqlclient") >= 0) { return DatabaseType.MySQL; } #endregion #region Sqlite if (providerName.IndexOf("system.data.sqlite") >= 0) { return DatabaseType.SQLite; } if (providerName.IndexOf("mono.data.sqliteclient") >= 0) { return DatabaseType.SQLite; } #endregion #region SqlServerCe if (providerName.IndexOf("system.data.sqlserverce") >= 0) { return DatabaseType.SqlServerCe; } if (providerName.IndexOf("microsoft.sqlserverce.client") >= 0) { return DatabaseType.SqlServerCe; } #endregion #region Oracle if (providerName.IndexOf("system.data.oracleclient") >= 0) { return DatabaseType.Oracle; } if (providerName.IndexOf("oracle.dataaccess.client") >= 0) { return DatabaseType.Oracle; } #endregion #region Access if (providerName.IndexOf("system.data.oledb") >= 0) { String dataSource = ""; String[] parameters = connectionString.Replace(" ", "").ToLowerInvariant().Split(';'); if (parameters != null && parameters.Length > 0) { Int32 dataSourcePos = -1; for (Int32 i = 0; i < parameters.Length; i++) { dataSourcePos = parameters[i].IndexOf("datasource"); if (dataSourcePos > -1) { dataSource = parameters[i]; break; } } } if (dataSource.IndexOf(".mdb") > -1) { return DatabaseType.Access; } else if (dataSource.IndexOf(".accdb") > -1) { return DatabaseType.Access; } } #endregion return DatabaseType.Unknown; }
public DbHelper(int tenant, ConnectionStringSettings connectionString) { this.tenant = tenant; factory = connectionString.ProviderName == "System.Data.SQLite" ? GetSQLiteFactory() : GetMySqlFactory(); builder = factory.CreateCommandBuilder(); connect = factory.CreateConnection(); connect.ConnectionString = connectionString.ConnectionString; connect.Open(); if (factory.GetType().Name == "MySqlClientFactory") { CreateCommand("set @@session.sql_mode = concat(@@session.sql_mode, ',NO_AUTO_VALUE_ON_ZERO')").ExecuteNonQuery(); } columns = connect.GetSchema("Columns"); whereExceptions["calendar_calendar_item"] = " where calendar_id in (select id from calendar_calendars where tenant = " + tenant + ") "; whereExceptions["calendar_calendar_user"] = "******" + tenant + ") "; whereExceptions["calendar_event_item"] = " where event_id in (select id from calendar_events where tenant = " + tenant + ") "; whereExceptions["calendar_event_user"] = "******" + tenant + ") "; whereExceptions["crm_entity_contact"] = " where contact_id in (select id from crm_contact where tenant_id = " + tenant + ") "; whereExceptions["crm_entity_tag"] = " where tag_id in (select id from crm_tag where tenant_id = " + tenant + ") "; whereExceptions["files_folder_tree"] = " where folder_id in (select id from files_folder where tenant_id = " + tenant + ") "; whereExceptions["forum_answer_variant"] = " where answer_id in (select id from forum_answer where tenantid = " + tenant + ")"; whereExceptions["forum_topic_tag"] = " where topic_id in (select id from forum_topic where tenantid = " + tenant + ")"; whereExceptions["forum_variant"] = " where question_id in (select id from forum_question where tenantid = " + tenant + ")"; whereExceptions["projects_project_participant"] = " where project_id in (select id from projects_projects where tenant_id = " + tenant + ")"; whereExceptions["projects_following_project_participant"] = " where project_id in (select id from projects_projects where tenant_id = " + tenant + ")"; whereExceptions["projects_project_tag"] = " where project_id in (select id from projects_projects where tenant_id = " + tenant + ")"; whereExceptions["projects_project_tag_change_request"] = " where project_id in (select id from projects_projects where tenant_id = " + tenant + ")"; whereExceptions["tenants_tenants"] = " where id = " + tenant; whereExceptions["webstudio_widgetstate"] = " where widgetcontainerid in (select id from webstudio_widgetcontainer where tenantid = " + tenant + ")"; whereExceptions["core_usersecurity"] = " where userid in (select id from core_user where tenant = " + tenant + ")"; whereExceptions["core_acl"] = " where tenant = " + tenant + " or tenant = -1"; whereExceptions["core_subscription"] = " where tenant = " + tenant + " or tenant = -1"; whereExceptions["core_subscriptionmethod"] = " where tenant = " + tenant + " or tenant = -1"; }
private static string GetErrorMessageWorthyProviderName(DbProviderFactory factory) { EntityUtil.CheckArgumentNull(factory, "factory"); string providerName; if (!EntityUtil.TryGetProviderInvariantName(factory, out providerName)) { providerName = factory.GetType().FullName; } return providerName; }
/// <summary> /// Uses DbProviderFactory to create a DbConnection /// </summary> private DbConnection GetStoreConnection(DbProviderFactory factory) { DbConnection storeConnection = factory.CreateConnection(); if (storeConnection == null) { throw EntityUtil.ProviderIncompatible(System.Data.Entity.Strings.EntityClient_ReturnedNullOnProviderMethod("CreateConnection", factory.GetType().Name)); } return storeConnection; }
public RelationalDatabaseWriter( DocumentDatabase database, SqlReplicationConfig cfg, SqlReplicationStatistics replicationStatistics) { this.database = database; this.cfg = cfg; this.replicationStatistics = replicationStatistics; providerFactory = GetDbProviderFactory(cfg); commandBuilder = providerFactory.CreateCommandBuilder(); connection = providerFactory.CreateConnection(); Debug.Assert(connection != null); Debug.Assert(commandBuilder != null); connection.ConnectionString = cfg.ConnectionString; try { connection.Open(); } catch (Exception e) { database.AddAlert(new Alert { AlertLevel = AlertLevel.Error, CreatedAt = SystemTime.UtcNow, Exception = e.ToString(), Title = "Sql Replication could not open connection", Message = "Sql Replication could not open connection to " + connection.ConnectionString, UniqueKey = "Sql Replication Connection Error: " + connection.ConnectionString }); throw; } tx = connection.BeginTransaction(); stringParserList = new List<Func<DbParameter, string, bool>> { (colParam, value) => { if( char.IsDigit( value[ 0 ] ) ) { DateTime dateTime; if (DateTime.TryParseExact(value, Default.OnlyDateTimeFormat, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out dateTime)) { switch( providerFactory.GetType( ).Name ) { case "MySqlClientFactory": colParam.Value = dateTime.ToString( "yyyy-MM-dd HH:mm:ss.ffffff" ); break; default: colParam.Value = dateTime; break; } return true; } } return false; }, (colParam, value) => { if( char.IsDigit( value[ 0 ] ) ) { DateTimeOffset dateTimeOffset; if( DateTimeOffset.TryParseExact( value, Default.DateTimeFormatsToRead, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out dateTimeOffset ) ) { switch( providerFactory.GetType( ).Name ) { case "MySqlClientFactory": colParam.Value = dateTimeOffset.ToUniversalTime().ToString( "yyyy-MM-dd HH:mm:ss.ffffff" ); break; default: colParam.Value = dateTimeOffset; break; } return true; } } return false; } }; }
/// <summary> /// Unwraps a wrapped <see cref="DbProviderFactory"/>. /// </summary> /// <param name="factory">The factory to unwrap.</param> /// <returns>The unwrapped factory or the original factory if no wrapping occurred.</returns> internal static DbProviderFactory Unwrap(DbProviderFactory factory) { var sp = factory as IServiceProvider; if (sp == null) return factory; var unwrapped = sp.GetService(factory.GetType()) as DbProviderFactory; return unwrapped == null ? factory : Unwrap(unwrapped); }
/// <summary> /// Creates an instance of a query runner for the specified database. /// </summary> /// <param name="factory">The factory.</param> /// <param name="connectionString">The connection string.</param> /// <param name="enableQueryBatching">The enable query batching.</param> /// <param name="commandTimeout">The command timeout.</param> /// <returns> /// A <see cref="QueryRunner"/> instance acording to the parameters. /// </returns> /// <remarks> /// <example> /// var runner = QueryRunner.Create(DbProviderFactories.GetFactory("System.Data.SqlClient"), connStr, true); /// runner.ExecuteQuery("select * from Employees\r\nGO\r\nSelect * from Products"); /// // runner.Batch.Queries.Count == 2 // /// </example> /// </remarks> public static QueryRunner Create(DbProviderFactory factory, string connectionString, bool enableQueryBatching, int commandTimeout) { if (factory.GetType().Name == "SqlClientFactory") { return new SqlQueryRunner(factory, connectionString, enableQueryBatching, commandTimeout); } // otherwise ise the default return new QueryRunner(factory, connectionString, enableQueryBatching, commandTimeout); }
private void RegisterFromConnectionStringSettings(ConnectionStringSettings cs) { ConnectionString = cs.ConnectionString; Provider = DbProviderFactories.GetFactory(cs.ProviderName); _hash = string.Concat(ConnectionString, Provider.GetType().AssemblyQualifiedName).GetHashCode(); }
public OracleDoubleConverter(DbProviderFactory factory) { OracleAssembly = factory.GetType().Assembly; var readerType = OracleAssembly.GetType("Oracle.DataAccess.Client.OracleDataReader"); GetOracleValue = readerType.GetMethod("GetOracleValue", BindingFlags.Public | BindingFlags.Instance); }
/// <devdoc> /// Gets the DbProviderFactory and performs a security check. /// </devdoc> private DbProviderFactory GetDbProviderFactorySecure() { if (_providerFactory == null) { _providerFactory = GetDbProviderFactory(); Debug.Assert(_providerFactory != null); if (!HttpRuntime.DisableProcessRequestInApplicationTrust) { // Perform security check if we're not running in application trust if (!HttpRuntime.ProcessRequestInApplicationTrust && !HttpRuntime.HasDbPermission(_providerFactory)) { throw new HttpException(SR.GetString(SR.SqlDataSource_NoDbPermission, _providerFactory.GetType().Name, ID)); } } } return _providerFactory; }
public bool Matches(DbProviderFactory factory) { return ((this.CachedFactory != null) && this.CachedFactory.GetType().Equals(factory.GetType())); }
public static string GetInvariantProviderName(DbProviderFactory factory) { if (factory == null) { throw new ArgumentNullException("factory"); } if (providerData.Matches(factory)) { return providerData.CachedInvariantProviderName; } EnsureFactoryTable(); string assemblyQualifiedName = factory.GetType().AssemblyQualifiedName; foreach (DataRow row in factoryTable.Rows) { if (StringUtil.EqualValue((string) row[PROVIDER_ASSEMBLY], assemblyQualifiedName)) { providerData.Initialize(factory, (string) row[PROVIDER_INVARIANT_NAME], (string) row[PROVIDER_NAME]); return providerData.CachedInvariantProviderName; } } throw new InternalException(string.Format(CultureInfo.CurrentCulture, "Unable to get invariant name from factory. Factory type is {0}", new object[] { factory.GetType().ToString() })); }
private static string GetParameterName(DbProviderFactory providerFactory, DbCommandBuilder commandBuilder, string paramName) { switch (providerFactory.GetType().Name) { case "SqlClientFactory": case "MySqlClientFactory": return "@" + paramName; case "OracleClientFactory": case "NpgsqlFactory": return ":" + paramName; default: // If we don't know, try to get it from the CommandBuilder. return getParameterNameFromBuilder(commandBuilder, paramName); } }
private static IDbExecutionStrategy GetExecutionStrategy( DbConnection connection, DbProviderFactory providerFactory, string providerInvariantName = null) { var entityConnection = connection as EntityConnection; if (entityConnection != null) { connection = entityConnection.StoreConnection; } var dataSource = DbInterception.Dispatch.Connection.GetDataSource(connection, new DbInterceptionContext()); // Using the type name of DbProviderFactory implementation instead of the provider invariant name for performance var cacheKey = new ExecutionStrategyKey(providerFactory.GetType().FullName, dataSource); var factory = _executionStrategyFactories.GetOrAdd( cacheKey, k => DbConfiguration.DependencyResolver.GetService<Func<IDbExecutionStrategy>>( new ExecutionStrategyKey( providerInvariantName ?? DbConfiguration.DependencyResolver.GetService<IProviderInvariantName>(providerFactory).Name, dataSource))); return factory(); }
// <summary> // Uses DbProviderFactory to create a DbConnection // </summary> private static DbConnection GetStoreConnection(DbProviderFactory factory) { var storeConnection = factory.CreateConnection(); if (storeConnection == null) { throw new ProviderIncompatibleException( Strings.EntityClient_ReturnedNullOnProviderMethod("CreateConnection", factory.GetType().Name)); } return storeConnection; }
private string GetProviderName(DbProviderFactory dbProviderFactory) { return dbProviderFactory.GetType().Namespace; }
private static IExecutionStrategy GetExecutionStrategy( DbConnection connection, DbProviderFactory providerFactory) { var entityConnection = connection as EntityConnection; if (entityConnection != null) { connection = entityConnection.StoreConnection; } // Using the type name of DbProviderFactory implementation instead of the provider invariant name for performance var cacheKey = new ExecutionStrategyKey(providerFactory.GetType().FullName, connection.DataSource); var factory = _executionStrategyFactories.GetOrAdd( cacheKey, k => DbConfiguration.GetService<Func<IExecutionStrategy>>( new ExecutionStrategyKey( DbConfiguration.GetService<IProviderInvariantName>(providerFactory).Name, connection.DataSource))); return factory(); }
private static bool IsSqlCeClientFactory(DbProviderFactory factory) { return (factory.GetType().FullName == "System.Data.SqlServerCe.SqlCeProviderFactory"); }