Class Connector<TOptions, TConnection>
- Namespace
- Steeltoe.Connectors
- Assembly
- Steeltoe.Connectors.dll
Provides access to driver-specific options and its connection object for a service binding.
public sealed class Connector<TOptions, TConnection> : IDisposable where TOptions : ConnectionStringOptions where TConnection : class
Type Parameters
TOptions
The driver-specific options type.
TConnection
The driver-specific connection type.
- Inheritance
-
Connector<TOptions, TConnection>
- Implements
- Inherited Members
Constructors
Connector(IServiceProvider, string, ConnectorCreateConnection, bool)
public Connector(IServiceProvider serviceProvider, string serviceBindingName, ConnectorCreateConnection createConnection, bool useSingletonConnection)
Parameters
serviceProvider
IServiceProviderserviceBindingName
stringcreateConnection
ConnectorCreateConnectionuseSingletonConnection
bool
Properties
Options
Gets the options for this service binding.
public TOptions Options { get; }
Property Value
- TOptions
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetConnection()
Gets a connection for this service binding. Depending on the connector type, this either creates a new connection or returns a cached instance.
public TConnection GetConnection()
Returns
- TConnection
The connection.