本文整理汇总了C#中IConnectionProvider.Connect方法的典型用法代码示例。如果您正苦于以下问题:C# IConnectionProvider.Connect方法的具体用法?C# IConnectionProvider.Connect怎么用?C# IConnectionProvider.Connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConnectionProvider
的用法示例。
在下文中一共展示了IConnectionProvider.Connect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TableWriter
public TableWriter(IShellContext context, IConnectionProvider connection, NameWithSchema name, TableInfo inputRowFormat, CopyTableTargetOptions options, TableInfo destinationTableOverride = null, LinkedDatabaseInfo linkedInfo = null, DataFormatSettings sourceDataFormat = null)
{
_connectionProvider = connection;
_linkedInfo = linkedInfo;
_name = name;
_inputRowFormat = inputRowFormat;
_queue = new CdlDataQueue(inputRowFormat);
_context = context;
_inserter = connection.Factory.CreateBulkInserter();
_inserter.SourceDataFormat = sourceDataFormat;
_connection = _connectionProvider.Connect();
_inserter.Connection = _connection;
_inserter.Factory = connection.Factory;
_inserter.LinkedInfo = _linkedInfo;
var db = context.GetDatabaseStructure(connection.ProviderString);
_inserter.DestinationTable = destinationTableOverride ?? db.FindTableLike(_name.Schema, _name.Name);
_inserter.CopyOptions = options;
_inserter.Log += _inserter_Log;
_thread = new Thread(Run);
_thread.Start();
}
示例2: RabbitWrapper
/// <summary>
/// Initializes a new instance of the <see cref="RabbitWrapper"/> class.
/// </summary>
/// <param name="connectionProvider">The connection provider.</param>
/// <param name="rabbitWrapperType">Type of the rabbit wrapper.</param>
internal RabbitWrapper(IConnectionProvider<IRabbitConnection> connectionProvider, RabbitWrapperType rabbitWrapperType)
{
_connectionProvider = connectionProvider;
_rabbitWrapperType = rabbitWrapperType;
_connection = _connectionProvider.Connect();
}