C# Class Tortuga.Chain.SqlServerDataSource

Class SqlServerDataSource.
Inheritance: SqlServerDataSourceBase, IRootDataSource
Afficher le fichier Open project: docevaad/Chain Class Usage Examples

Private Properties

Свойство Type Description
BuildConnectionSettingsOverride string
CreateConnection System.Data.SqlClient.SqlConnection
CreateConnectionAsync Task
Execute int?
GetEffectiveSettings Tortuga.Chain.SqlServer.SqlServerEffectiveSettings
GetEffectiveSettingsAsync Task
IRootDataSource System.Data.Common.DbConnection
IRootDataSource IOpenDataSource
IRootDataSource ITransactionalDataSource
IRootDataSource Task
IRootDataSource Task
SqlServerDataSource System

Méthodes publiques

Méthode Description
BeginTransaction ( string transactionName = null, IsolationLevel isolationLevel = null, bool forwardEvents = true ) : SqlServerTransactionalDataSource

Creates a new transaction

the caller of this function is responsible for closing the transaction.

BeginTransactionAsync ( string transactionName = null, IsolationLevel isolationLevel = null, bool forwardEvents = true ) : Task

Creates a new transaction

CreateFromConfig ( string connectionName ) : SqlServerDataSource

Creates a new connection using the connection string settings in the app.config file.

SqlServerDataSource ( System.Data.SqlClient.SqlConnectionStringBuilder connectionStringBuilder, SqlServerDataSourceSettings settings = null ) : System

Initializes a new instance of the SqlServerDataSource class.

SqlServerDataSource ( string name, System.Data.SqlClient.SqlConnectionStringBuilder connectionStringBuilder, SqlServerDataSourceSettings settings = null ) : System

Initializes a new instance of the SqlServerDataSource class.

SqlServerDataSource ( string connectionString, SqlServerDataSourceSettings settings = null ) : System

Initializes a new instance of the SqlServerDataSource class.

SqlServerDataSource ( string name, string connectionString, SqlServerDataSourceSettings settings = null ) : System

Initializes a new instance of the SqlServerDataSource class.

StartSqlDependency ( ) : bool

Starts SQL dependency.

true if the listener initialized successfully; false if a compatible listener already exists.

StopSqlDependency ( ) : bool

Stops SQL dependency.

true if the listener was completely stopped; false if the System.AppDomain was unbound from the listener, but there are is at least one other System.AppDomain using the same listener.

TestConnection ( ) : void

Tests the connection.

TestConnectionAsync ( ) : Task

Tests the connection asynchronously.

WithCache ( ICacheAdapter cache ) : SqlServerDataSource

Craetes a new data source with the provided cache.

WithRules ( ) : SqlServerDataSource

Creates a new data source with additional audit rules.

WithRules ( IEnumerable additionalRules ) : SqlServerDataSource

Creates a new data source with additional audit rules.

WithSettings ( SqlServerDataSourceSettings settings ) : SqlServerDataSource

Creates a new data source with the indicated changes to the settings.

The new data source will share the same database metadata cache.

WithUser ( object userValue ) : SqlServerDataSource

Creates a new data source with the indicated user.

This is used in conjunction with audit rules.

Méthodes protégées

Méthode Description
Execute ( SqlTransaction>.OperationExecutionToken executionToken, SqlTransaction>.OperationImplementation implementation, object state ) : int?

Executes the specified operation.

ExecuteAsync ( SqlParameter>.CommandExecutionToken executionToken, CommandImplementationAsync implementation, CancellationToken cancellationToken, object state ) : Task

Execute the operation asynchronously.

ExecuteAsync ( SqlTransaction>.OperationExecutionToken executionToken, SqlTransaction>.OperationImplementationAsync implementation, CancellationToken cancellationToken, object state ) : Task

Execute the operation asynchronously.

Private Methods

Méthode Description
BuildConnectionSettingsOverride ( ) : string
CreateConnection ( ) : SqlConnection
CreateConnectionAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task

Creates and opens a SQL connection.

The caller of this method is responsible for closing the connection.

Execute ( SqlParameter>.CommandExecutionToken executionToken, CommandImplementation implementation, object state ) : int?
GetEffectiveSettings ( ) : SqlServerEffectiveSettings
GetEffectiveSettingsAsync ( ) : Task
IRootDataSource ( ) : DbConnection
IRootDataSource ( DbConnection connection, DbTransaction transaction ) : IOpenDataSource
IRootDataSource ( ) : ITransactionalDataSource
IRootDataSource ( ) : Task
IRootDataSource ( ) : Task
SqlServerDataSource ( string name, System.Data.SqlClient.SqlConnectionStringBuilder connectionStringBuilder, SqlServerDataSourceSettings settings, SqlServerMetadataCache databaseMetadata, ICacheAdapter cache, object>.ConcurrentDictionary extensionCache ) : System

Method Details

BeginTransaction() public méthode

Creates a new transaction
the caller of this function is responsible for closing the transaction.
public BeginTransaction ( string transactionName = null, IsolationLevel isolationLevel = null, bool forwardEvents = true ) : SqlServerTransactionalDataSource
transactionName string optional name of the transaction.
isolationLevel IsolationLevel the isolation level. if not supplied, will use the database default.
forwardEvents bool if true, logging events are forwarded to the parent connection.
Résultat SqlServerTransactionalDataSource

BeginTransactionAsync() public méthode

Creates a new transaction
public BeginTransactionAsync ( string transactionName = null, IsolationLevel isolationLevel = null, bool forwardEvents = true ) : Task
transactionName string Name of the transaction.
isolationLevel IsolationLevel The isolation level.
forwardEvents bool if set to true [forward events].
Résultat Task

CreateFromConfig() public static méthode

Creates a new connection using the connection string settings in the app.config file.
public static CreateFromConfig ( string connectionName ) : SqlServerDataSource
connectionName string
Résultat SqlServerDataSource

Execute() protected méthode

Executes the specified operation.
protected Execute ( SqlTransaction>.OperationExecutionToken executionToken, SqlTransaction>.OperationImplementation implementation, object state ) : int?
executionToken SqlTransaction>.OperationExecutionToken The execution token.
implementation SqlTransaction>.OperationImplementation The implementation.
state object The state.
Résultat int?

ExecuteAsync() protected méthode

Execute the operation asynchronously.
protected ExecuteAsync ( SqlParameter>.CommandExecutionToken executionToken, CommandImplementationAsync implementation, CancellationToken cancellationToken, object state ) : Task
executionToken SqlParameter>.CommandExecutionToken The execution token.
implementation CommandImplementationAsync The implementation that handles processing the result of the command.
cancellationToken System.Threading.CancellationToken The cancellation token.
state object User supplied state.
Résultat Task

ExecuteAsync() protected méthode

Execute the operation asynchronously.
protected ExecuteAsync ( SqlTransaction>.OperationExecutionToken executionToken, SqlTransaction>.OperationImplementationAsync implementation, CancellationToken cancellationToken, object state ) : Task
executionToken SqlTransaction>.OperationExecutionToken The execution token.
implementation SqlTransaction>.OperationImplementationAsync The implementation.
cancellationToken System.Threading.CancellationToken The cancellation token.
state object The state.
Résultat Task

SqlServerDataSource() public méthode

Initializes a new instance of the SqlServerDataSource class.
public SqlServerDataSource ( System.Data.SqlClient.SqlConnectionStringBuilder connectionStringBuilder, SqlServerDataSourceSettings settings = null ) : System
connectionStringBuilder System.Data.SqlClient.SqlConnectionStringBuilder The connection string builder.
settings Tortuga.Chain.SqlServer.SqlServerDataSourceSettings Optional settings object.
Résultat System

SqlServerDataSource() public méthode

Initializes a new instance of the SqlServerDataSource class.
connectionStringBuilder;connectionStringBuilder is null.
public SqlServerDataSource ( string name, System.Data.SqlClient.SqlConnectionStringBuilder connectionStringBuilder, SqlServerDataSourceSettings settings = null ) : System
name string Optional name of the data source.
connectionStringBuilder System.Data.SqlClient.SqlConnectionStringBuilder The connection string builder.
settings Tortuga.Chain.SqlServer.SqlServerDataSourceSettings Optional settings object.
Résultat System

SqlServerDataSource() public méthode

Initializes a new instance of the SqlServerDataSource class.
connectionString is null or empty.;connectionString
public SqlServerDataSource ( string connectionString, SqlServerDataSourceSettings settings = null ) : System
connectionString string The connection string.
settings Tortuga.Chain.SqlServer.SqlServerDataSourceSettings Optional settings object.
Résultat System

SqlServerDataSource() public méthode

Initializes a new instance of the SqlServerDataSource class.
connectionString is null or empty.;connectionString
public SqlServerDataSource ( string name, string connectionString, SqlServerDataSourceSettings settings = null ) : System
name string Name of the data source.
connectionString string The connection string.
settings Tortuga.Chain.SqlServer.SqlServerDataSourceSettings Optional settings object.
Résultat System

StartSqlDependency() public méthode

Starts SQL dependency.
true if the listener initialized successfully; false if a compatible listener already exists.
public StartSqlDependency ( ) : bool
Résultat bool

StopSqlDependency() public méthode

Stops SQL dependency.
true if the listener was completely stopped; false if the System.AppDomain was unbound from the listener, but there are is at least one other System.AppDomain using the same listener.
public StopSqlDependency ( ) : bool
Résultat bool

TestConnection() public méthode

Tests the connection.
public TestConnection ( ) : void
Résultat void

TestConnectionAsync() public méthode

Tests the connection asynchronously.
public TestConnectionAsync ( ) : Task
Résultat Task

WithCache() public méthode

Craetes a new data source with the provided cache.
public WithCache ( ICacheAdapter cache ) : SqlServerDataSource
cache ICacheAdapter The cache.
Résultat SqlServerDataSource

WithRules() public méthode

Creates a new data source with additional audit rules.
public WithRules ( ) : SqlServerDataSource
Résultat SqlServerDataSource

WithRules() public méthode

Creates a new data source with additional audit rules.
public WithRules ( IEnumerable additionalRules ) : SqlServerDataSource
additionalRules IEnumerable The additional rules.
Résultat SqlServerDataSource

WithSettings() public méthode

Creates a new data source with the indicated changes to the settings.
The new data source will share the same database metadata cache.
public WithSettings ( SqlServerDataSourceSettings settings ) : SqlServerDataSource
settings Tortuga.Chain.SqlServer.SqlServerDataSourceSettings The new settings to use.
Résultat SqlServerDataSource

WithUser() public méthode

Creates a new data source with the indicated user.
This is used in conjunction with audit rules.
public WithUser ( object userValue ) : SqlServerDataSource
userValue object The user value.
Résultat SqlServerDataSource