Ejemplo n.º 1
0
		protected DatabaseFixtureBase()
		{
			ConnectionString = GetConnectionString();
			ProviderName = PROVIDER_NAME;
			Factory = DbProviderFactories.GetFactory(ProviderName);
			Dialect = GetDialect();

			if (Dialect == null) throw new InvalidOperationException($"No valid dialect detected for: {ProviderName}");
		}
		public AdoNetUnitOfWorkScope(AdoNetUnitOfWork unitOfWork, SqlDialect dialect, IDbConnection connection)
		{
			if (unitOfWork == null) throw new ArgumentNullException(nameof(unitOfWork));

			_unitOfWork = unitOfWork;
			Dialect = dialect;
			Connection = connection;

			_log.Debug("Created new instance: {0} (UnitOfWork: {1})", GetHashCode(), unitOfWork.GetHashCode());
		}
		public AdoNetConnectionFactory(string connectionString, string providerName)
		{
			_connectionString = connectionString;
			_providerName = providerName;
			_factory = DbProviderFactories.GetFactory(providerName);
			_dialect = SqlDialect.GetDialectFor(_factory, connectionString);

			if (_dialect == null) throw new InvalidOperationException($"Unable to guess dialect for: {connectionString}");

		}
Ejemplo n.º 4
0
		public static void Register(SqlDialect dialect)
		{
			lock (_dialects)
			{
				_dialects.Add(dialect);
			}
		}