本文整理汇总了C#中IDbFactory类的典型用法代码示例。如果您正苦于以下问题:C# IDbFactory类的具体用法?C# IDbFactory怎么用?C# IDbFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDbFactory类属于命名空间,在下文中一共展示了IDbFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WithSqlStorages
public static IConfigureHost WithSqlStorages(this IConfigureHost host,IDbFactory connection ,Action<StoragesConfiguration> cfgAction)
{
cfgAction.MustNotBeNull();
var cfg=new StoragesConfiguration(host,connection);
cfgAction(cfg);
return host;
}
示例2: CreateConnectionSettingsWidget
protected override ConnectionSettingsWidget CreateConnectionSettingsWidget (IDbFactory factory)
{
connectionWidget = new ConnectionSettingsWidget (factory);
connectionWidget.ShowSettings (factory.GetDefaultConnectionSettings ());
connectionWidget.EnableTestButton = false;
return connectionWidget;
}
示例3: AzureProcessor
public AzureProcessor(IDbConnection connection, IMigrationGenerator generator, IAnnouncer announcer, IMigrationProcessorOptions options, IDbFactory factory)
: base(generator, announcer, options)
{
this.factory = factory;
Connection = connection;
connection.Open();
}
示例4: GenericProcessorBase
protected GenericProcessorBase(IDbConnection connection, IDbFactory factory
, IMigrationGenerator generator, IAnnouncer announcer, IMigrationProcessorOptions options)
: base(generator, announcer, options)
{
Connection = connection;
Factory = factory;
}
示例5: SetUp
protected void SetUp(IDbFactory dbFactory)
{
this.Factory = dbFactory;
this.Connection = this.Factory.CreateConnection(IntegrationTestOptions.Oracle.ConnectionString);
this.Processor = new OracleProcessor(this.Connection, new OracleGenerator(), new TextWriterAnnouncer(System.Console.Out), new ProcessorOptions(), this.Factory);
this.Connection.Open();
}
示例6: NpgsqlCreateDatabaseDialog
public NpgsqlCreateDatabaseDialog (IDbFactory factory):base(factory)
{
createDBWidget = new NpgsqlCreateDatabaseWidget ();
Notebook.AppendPage (createDBWidget,
new Label (AddinCatalog.GetString ("Database Properties")));
Notebook.ShowTabs = true;
Gtk.Notebook nb = Notebook;
nb.SwitchPage += delegate(object o, SwitchPageArgs args) {
if (nb.CurrentPage == 1)
if (!connectionWidget.ValidateFields ())
{
nb.CurrentPage = 0;
MessageService.ShowError (this,
AddinCatalog.GetString ("Set the connection properties before the database properties."));
} else {
Initialize (factory);
if (DatabaseConnection.ConnectionPool.HasErrors) {
MessageService.ShowError (DatabaseConnection.ConnectionPool.Error);
nb.CurrentPage = 0;
return;
}
createDBWidget.Initialize ((NpgsqlSchemaProvider)DatabaseConnection.SchemaProvider);
}
};
Notebook.ShowAll ();
}
示例7: SqlServerProcessor
public SqlServerProcessor(DbConnection connection, IMigrationGenerator generator, IAnnouncer announcer, IMigrationProcessorOptions options, IDbFactory factory)
: base(generator, announcer, options)
{
this.factory = factory;
Connection = connection;
connection.Open();
BeginTransaction();
}
示例8: DatabaseConnectionSettingsDialog
public DatabaseConnectionSettingsDialog (IDbFactory factory, DatabaseConnectionSettings settings)
: this (factory, true)
{
if (settings == null)
throw new ArgumentNullException ("settings");
settingsWidget.ShowSettings (settings);
settingsWidget.AppendDatabase (settings);
}
示例9: UnitOfWork
public UnitOfWork(IDbFactory dbFactory)
{
if (dbFactory == null)
{
throw new ArgumentNullException("dbFactory");
}
_dbFactory = dbFactory;
}
示例10: SqliteConnectionSettingsWidget
internal SqliteConnectionSettingsWidget (IDbFactory factory, bool isEditMode)
: base (factory, isEditMode)
{
EnableServerEntry = false;
EnablePortEntry = false;
EnableUsernameEntry = false;
EnablePasswordEntry = false;
EnableRefreshButton = false;
EnableOpenButton = true;
}
示例11: DbDatabasePopulator
public DbDatabasePopulator(IDbFactory dbFactory, string connectionString)
{
if (dbFactory == null)
throw new ArgumentNullException("dbFactory");
if (connectionString == null)
throw new ArgumentNullException("connectionString");
this.dbFactory = dbFactory;
this.connectionString = connectionString;
}
示例12: PostgresProcessor
public PostgresProcessor(IDbConnection connection, IMigrationGenerator generator, IAnnouncer announcer, IMigrationProcessorOptions options, IDbFactory factory)
: base(generator, announcer, options)
{
this.factory = factory;
Connection = connection;
connection.Open();
Announcer.Say("Beginning Transaction");
Transaction = Connection.BeginTransaction();
}
示例13: Initialize
private void Initialize (IDbFactory factory)
{
if (DatabaseConnection != null)
DatabaseConnection.ConnectionPool.Close ();
DatabaseConnectionSettings settings = new DatabaseConnectionSettings(connectionWidget.ConnectionSettings);
settings.Database = "mysql";
// Create Context, Pool, Connection
DatabaseConnectionContext ctx = new DatabaseConnectionContext (settings, true);
ctx.ConnectionPool.Initialize ();
this.DatabaseConnection = ctx;
}
示例14: ReceiveFromClientsBySql
public static void ReceiveFromClientsBySql(this DispatchServerConfiguration cfg,IDbFactory connection,string table=CommunicatorTable,string dbSchema=CommunicatorSchema)
{
new ClientToServerRowCreator(connection).WithTableName(table, dbSchema).IfExists(TableExistsAction.Ignore).Create();
var configReceiver = new ConfigReceiver(connection);
cfg.EndpointUpdatesNotifier=configReceiver;
var fromClient = new ReceiverFromClient(connection);
cfg.MessageNotifier = fromClient;
}
示例15: DbAdministratorBase
/// <summary>
/// Initializes an instance of <see cref="DbAdministratorBase"/> with the connection string.
/// </summary>
/// <param name="connectionString">Connection string to the SQL server without initial catalog</param>
/// <param name="databaseName">Catalog name</param>
/// <param name="factory">The factory to use.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="connectionString"/> is a null reference (Nothing in Visual Basic)
/// </exception>
public DbAdministratorBase(string connectionString, string databaseName, IDbFactory factory)
{
if (connectionString==null)
throw new ArgumentNullException("connectionString");
if (databaseName==null)
throw new ArgumentNullException("databaseName");
if(factory==null)
throw new ArgumentNullException("factory");
this.connectionString=connectionString.TrimEnd(';');
this.databaseName=databaseName;
this.factory=factory;
}