本文整理汇总了C#中IConnectionString类的典型用法代码示例。如果您正苦于以下问题:C# IConnectionString类的具体用法?C# IConnectionString怎么用?C# IConnectionString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IConnectionString类属于命名空间,在下文中一共展示了IConnectionString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SisoConnectionInfo
public SisoConnectionInfo(IConnectionString connectionString)
{
if(connectionString == null)
throw new ArgumentNullException("connectionString");
Initialize(connectionString);
}
示例2: ConvertToConnectionString
private static string ConvertToConnectionString(IConnectionString connectionString)
{
var cnStringBuilder = new SqlCeConnectionStringBuilder(connectionString.PlainString);
cnStringBuilder.Enlist = false;
return connectionString.ReplacePlain(cnStringBuilder.ConnectionString).PlainString;
}
示例3: OpenServerConnection
public IDbConnection OpenServerConnection(IConnectionString connectionString)
{
var cn = new SqlCeConnection(connectionString.PlainString);
cn.Open();
return cn;
}
示例4: OnFormatConnectionString
protected override IConnectionString OnFormatConnectionString(IConnectionString connectionString)
{
var cnString = base.OnFormatConnectionString(connectionString);
var cnStringBuilder = new SqlCeConnectionStringBuilder(cnString.PlainString) { Enlist = false };
return connectionString.ReplacePlain(cnStringBuilder.ConnectionString);
}
示例5: OnFormatServerConnectionString
protected override IConnectionString OnFormatServerConnectionString(IConnectionString connectionString)
{
var cnString = base.OnFormatServerConnectionString(connectionString);
var cnStringBuilder = new SqlConnectionStringBuilder(cnString.PlainString) { InitialCatalog = string.Empty };
return cnString.ReplacePlain(cnStringBuilder.ConnectionString);
}
示例6: DatabaseFactory
public DatabaseFactory(IConnectionString connectionString, ILogWriter logWriter)
{
Checks.Argument.IsNotNull(connectionString, "connectionString");
_connectionString = connectionString.Value;
_logWriter = logWriter;
}
示例7: NHibernateSessionSource
public NHibernateSessionSource(IEnumerable<IMappingConfiguration> mappingConfigurations,
IConnectionString connectionString)
{
_mappingConfigurations = mappingConfigurations;
_connectionString = connectionString;
_configuration = AssembleConfiguration(null);
_sessionFactory = _configuration.BuildSessionFactory();
}
示例8: Sql2008ConnectionInfo
public Sql2008ConnectionInfo(IConnectionString connectionString)
: base(connectionString)
{
if (ProviderType != StorageProviders.Sql2008)
throw new SisoDbException(ExceptionMessages.ConnectionInfo_UnsupportedProviderSpecified.Inject(ProviderType, StorageProviders.Sql2008));
InitializeDbNameAndServerConnectionString();
}
示例9: Add
/// <summary>
/// Adds the specified synced module index entry, together with the online connection string.
/// </summary>
/// <param name="connectionString">The connection string.</param>
/// <param name="entry">The entry.</param>
/// <remarks>Documented by Dev02, 2009-03-26</remarks>
public static void Add(IConnectionString connectionString, LearningModulesIndexEntry entry)
{
if (!syncedModules.ContainsKey(connectionString.ConnectionString))
syncedModules[connectionString.ConnectionString] = new List<LearningModulesIndexEntry>();
syncedModules[connectionString.ConnectionString].RemoveAll(e => e.SyncedPath == entry.SyncedPath && e.ConnectionName == entry.ConnectionName && e.UserName == entry.UserName);
syncedModules[connectionString.ConnectionString].Add(entry);
}
示例10: OnExtractDbName
protected override string OnExtractDbName(IConnectionString connectionString)
{
var filePath = ExtractFilePath(ClientConnectionString);
return filePath.Contains(Path.DirectorySeparatorChar.ToString())
? Path.GetFileNameWithoutExtension(filePath)
: filePath;
}
示例11: NHibernateConfigurationFactory
public NHibernateConfigurationFactory(
INHibernateMappingConfigurationFactory mappingConfigurationFactory,
IConnectionString connectionString,
IFoundationConfigurator foundationConfigurator)
{
this.mappingConfigurationFactory = mappingConfigurationFactory;
this.connectionString = connectionString;
this.foundationConfigurator = foundationConfigurator;
}
示例12: BasicConfiguration
public BasicConfiguration(IConnectionString connectionString) {
_configuration = new Configuration();
_configuration.Proxy(p => p.ProxyFactoryFactory<DefaultProxyFactoryFactory>())
.DataBaseIntegration(db => {
db.ConnectionString = connectionString.FormattedConnectionString;
db.Dialect<MsSql2008Dialect>();
})
.AddAssembly(typeof(NHTestEntity).Assembly);
}
示例13: EnsureCorrectProviderIfItExists
private void EnsureCorrectProviderIfItExists(IConnectionString connectionString)
{
var providerType = ExtractProviderType(connectionString);
if (providerType == null)
return;
if (providerType != ProviderType)
throw new SisoDbException(ExceptionMessages.ConnectionInfo_UnsupportedProviderSpecified.Inject(providerType, ProviderType));
}
示例14: SqlCe4ConnectionInfo
public SqlCe4ConnectionInfo(IConnectionString connectionString)
: base(StorageProviders.SqlCe4, connectionString)
{
_filePath = ExtractFilePath(ClientConnectionString);
_serverPath = Path.GetDirectoryName(FilePath);
if (string.IsNullOrWhiteSpace(DbName))
throw new SisoDbException(ExceptionMessages.ConnectionInfo_MissingName);
}
示例15: FormatServerConnectionString
private IConnectionString FormatServerConnectionString(IConnectionString connectionString)
{
try
{
return OnFormatServerConnectionString(connectionString);
}
catch (Exception ex)
{
throw new SisoDbException("Could not parse sent server connection string. If connection string name is passed. Ensure it has match in config-file. Inspect inner exception for more details.", new[] { ex });
}
}