Show / Hide Table of Contents

Class SqlDatabaseConnector

Provides a connection to a SQL Server database.

Inheritance
System.Object
SqlDatabaseConnector
Implements
IDatabaseConnector
IDisposable
Namespace: Paradigm.ORM.Data.SqlServer
Assembly: Paradigm.ORM.Data.SqlServer.dll
Syntax
public class SqlDatabaseConnector : object, IDatabaseConnector, IDisposable

Constructors

| Improve this Doc View Source

SqlDatabaseConnector()

Initializes a new instance of the SqlDatabaseConnector class.

Declaration
public SqlDatabaseConnector()
| Improve this Doc View Source

SqlDatabaseConnector(String)

Initializes a new instance of the SqlDatabaseConnector class.

Declaration
public SqlDatabaseConnector(string connectionString)
Parameters
Type Name Description
System.String connectionString

The connection string.

Properties

| Improve this Doc View Source

Configuration

Gets the database configuration.

Declaration
public IDatabaseConfiguration Configuration { get; }
Property Value
Type Description
IDatabaseConfiguration

The configuration.

| Improve this Doc View Source

ConnectionTimeout

Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error.

Declaration
public int ConnectionTimeout { get; }
Property Value
Type Description
System.Int32

The time (in seconds) to wait for a connection to open. The default value is 15 seconds.

Methods

| Improve this Doc View Source

Close()

Closes a previously opened connection to a database.

Declaration
public void Close()
| Improve this Doc View Source

CloseAsync()

Closes a previously opened connection to a database.

Declaration
public Task CloseAsync()
Returns
Type Description
Task
| Improve this Doc View Source

CreateCommand()

Creates a new database command.

Declaration
public IDatabaseCommand CreateCommand()
Returns
Type Description
IDatabaseCommand

A new Paradigm.ORM.Data.SqlServer.SqlDatabaseCommand.

| Improve this Doc View Source

CreateTransaction()

Creates a new database transaction.

Declaration
public IDatabaseTransaction CreateTransaction()
Returns
Type Description
IDatabaseTransaction

A new Paradigm.ORM.Data.SqlServer.SqlDatabaseTransaction.

| Improve this Doc View Source

CreateTransaction(IsolationLevel)

Creates a new database transaction.

Declaration
public IDatabaseTransaction CreateTransaction(IsolationLevel isolationLevel)
Parameters
Type Name Description
IsolationLevel isolationLevel

Specifies the transaction isolation level.

Returns
Type Description
IDatabaseTransaction

A new Paradigm.ORM.Data.SqlServer.SqlDatabaseTransaction.

| Improve this Doc View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
| Improve this Doc View Source

GetCommandBuilderFactory()

Gets a command builder factory.

Declaration
public ICommandBuilderFactory GetCommandBuilderFactory()
Returns
Type Description
ICommandBuilderFactory

The command builder factory related to this database type.

Remarks

The command builder factory creates command builders for standard crud actions over a given data type.

| Improve this Doc View Source

GetCommandFormatProvider()

Get a command text format provider.

Declaration
public ICommandFormatProvider GetCommandFormatProvider()
Returns
Type Description
ICommandFormatProvider

The command formatted realted to this database type.

Remarks

The command formatter gives basic functionality to format sql queries for each database type.

| Improve this Doc View Source

GetDbStringTypeConverter()

Gets a string type converter.

Declaration
public IDbStringTypeConverter GetDbStringTypeConverter()
Returns
Type Description
IDbStringTypeConverter

A database type converter.

Remarks

This converter can convert back and forth from a database type in string format, to a .NET type.

Examples

For the string "int" the converter will return . For the string "text" the converter will return .

| Improve this Doc View Source

GetDbTypeValueRangeProvider()

Gets the database type size provider.

Declaration
public IDbTypeValueRangeProvider GetDbTypeValueRangeProvider()
Returns
Type Description
IDbTypeValueRangeProvider
Remarks

A database type size provider retrieves minimum and maximum values for regular sql types like tinyint, smallint, int, etc.

| Improve this Doc View Source

GetSchemaProvider()

Get a database schema provider.

Declaration
public ISchemaProvider GetSchemaProvider()
Returns
Type Description
ISchemaProvider

A schema provider related to this database connection.

Remarks

The schema provider, allows to retrieve schema information about database objects like tables, views, stored procedures, etc.

| Improve this Doc View Source

GetValueConverter()

Gets the value converter.

Declaration
public IValueConverter GetValueConverter()
Returns
Type Description
IValueConverter

A value converter.

Remarks

This converter can convert from database objects to specific .net types.

| Improve this Doc View Source

Initialize(String)

Initializes the connection against the database.

Declaration
public void Initialize(string connectionString = null)
Parameters
Type Name Description
System.String connectionString

A connection string containing information to connect to a given database.

| Improve this Doc View Source

IsOpen()

Indicates if the connection is currently opened.

Declaration
public bool IsOpen()
Returns
Type Description
System.Boolean

True if the connection is opened, false otherwise.

| Improve this Doc View Source

Open()

Opens the conection to a database.

Declaration
public void Open()
| Improve this Doc View Source

OpenAsync()

Opens the conection to a database.

Declaration
public Task OpenAsync()
Returns
Type Description
Task

Implements

IDatabaseConnector
IDisposable

Extension Methods

ObjectExtensions.ThrowIfFails<TException>(Object, Action, String)
ObjectExtensions.ThrowIfFails<TException, TResult>(Object, Func<TResult>, String)
ObjectExtensions.ThrowIfFailsAsync<TException>(Object, Func<Task>, String)
ObjectExtensions.ThrowIfFailsAsync<TException, TResult>(Object, Func<Task<TResult>>, String)

See Also

IDatabaseConnector
  • Improve this Doc
  • View Source
Powered by MiracleDevs ©2017. Code licensed under the MIT License.
Documentation generated by DocFX.