Class SqlContext
Represents a Sql context.
Inheritance
System.Object
SqlContext
Implements
System.IDisposable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.BusinessFoundation.Data.Sql
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 12.17.2Syntax
public class SqlContext : IDisposable
Constructors
SqlContext()
Initializes a new instance of the SqlContext class.
Declaration
protected SqlContext()
SqlContext(String)
Initializes a new instance of the SqlContext class.
Declaration
public SqlContext(string connectionString)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | The connection string. |
Properties
CommandTimeout
Gets or sets the command timeout.
Declaration
public int CommandTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The command timeout. |
ConnectionString
Gets or sets the connection string.
Declaration
public virtual string ConnectionString { get; protected set; }
Property Value
Type | Description |
---|---|
System.String | The connection string. |
Current
Gets or sets the current.
Declaration
public static SqlContext Current { get; set; }
Property Value
Type | Description |
---|---|
SqlContext | The current. |
Database
Declaration
public Database Database { get; }
Property Value
Type | Description |
---|---|
Database |
Transaction
Gets or sets the transaction.
Declaration
public virtual SqlTransaction Transaction { get; set; }
Property Value
Type | Description |
---|---|
System.Data.SqlClient.SqlTransaction | The transaction. |
TransactionScope
Declaration
public virtual SqlTransactionScope TransactionScope { get; }
Property Value
Type | Description |
---|---|
SqlTransactionScope |
Methods
BeginTransaction()
Begins the transaction.
Declaration
public virtual SqlTransactionScope BeginTransaction()
Returns
Type | Description |
---|---|
SqlTransactionScope |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
FromConfig()
Froms the config.
Declaration
public static SqlContext FromConfig()
Returns
Type | Description |
---|---|
SqlContext |
GetTable(String)
Gets the table.
Declaration
public Table GetTable(string tableName)
Parameters
Type | Name | Description |
---|---|---|
System.String | tableName | Name of the table. |
Returns
Type | Description |
---|---|
Table |
Events
TransactionCommited
Occurs when [transaction commited].
Declaration
public static event EventHandler TransactionCommited
Event Type
Type | Description |
---|---|
System.EventHandler |
TransactionCreated
Occurs when [transaction created].
Declaration
public static event EventHandler TransactionCreated
Event Type
Type | Description |
---|---|
System.EventHandler |
TransactionRollbacked
Occurs when [transaction rollbacked].
Declaration
public static event EventHandler TransactionRollbacked
Event Type
Type | Description |
---|---|
System.EventHandler |
Implements
System.IDisposable