public ForConnection ( string connectionName, ISqlDialect sqlDialect, IDbDriver dbDriver ) : ICreateSessionFactory | ||
connectionName | string | |
sqlDialect | ISqlDialect | |
dbDriver | IDbDriver | |
return | ICreateSessionFactory |
public ICreateSessionFactory ForConnection(string connectionName, ISqlDialect sqlDialect, IDbDriver dbDriver)
{
if (connectionName == null)
{
throw new ArgumentNullException("connectionName");
}
var configSection = ConfigurationManager.ConnectionStrings[connectionName];
if (configSection == null)
{
throw new ConfigurationException(ExceptionMessages.FluentConfiguration_ConnectionNotFound.FormatWith(connectionName));
}
return this.ForConnection(configSection.Name, configSection.ConnectionString, configSection.ProviderName, sqlDialect, dbDriver);
}
FluentConfiguration::ForConnection ( string connectionName, string connectionString, string providerName, ISqlDialect sqlDialect, IDbDriver dbDriver ) : ICreateSessionFactory |
public WhenCallingCreateSessionFactory_WithNamedConnection() { var fluentConfiguration = new FluentConfiguration((ISessionFactory s) => { this.sessionFactoryCreatedCalled = true; return s; }); this.sessionFactory = fluentConfiguration .ForConnection("SqlConnection", this.mockSqlDialect.Object, this.mockDbDriver.Object) .CreateSessionFactory(); }