Click or drag to resize

DbContext Class

This class manages thread static connections and transactions
Inheritance Hierarchy
SystemObject
  Omada.OE.AppLogicDbContext

Namespace:  Omada.OE.AppLogic
Assembly:  Omada.OE.AppLogic (in Omada.OE.AppLogic.dll) Version: 15.0.0.0
Syntax
C#
public abstract class DbContext

The DbContext type exposes the following members.

Constructors
  NameDescription
Protected methodDbContext
Top
Properties
  NameDescription
Public propertyStatic memberConnection
Gets the current connection. Throws an exception if no connection is active.
Public propertyStatic memberCurrentTransaction
Gets the current transaction, or null if no transaction exists.
Public propertyStatic memberRequiredTransaction
Gets the current transaction, throwing an exception is no transaction exists.
Top
Methods
  NameDescription
Public methodStatic memberCode exampleDoInConnection(DbContextActionWithNoResult)
Execute an action which doesn't return a value. If no current connection exists, it will establish a connection to the customer database and close it afterwards. An existing connection will be reused. Inside the action, the connection is available as Connection.
Public methodStatic memberCode exampleDoInConnectionT(DbContextActionWithResultT)
Execute an action and return the result. If no current connection exists, it will establish a connection to the customer database and close it afterwards. An existing connection will be reused. Inside the action, the connection is available as Connection.
Public methodStatic memberDoInExistingConnection(DbContextActionWithNoResult, SqlConnection)
Public methodStatic memberCode exampleDoInExistingConnectionT(DbContextActionWithResultT, SqlConnection)
This will execute an action and return the result. While the action executes, Connection will be set to connectionToUse. If a current connection exists, it will be temporarily replaced by connectionToUse.
Public methodStatic memberDoInExistingTransaction(DbContextActionWithNoResult, SqlConnection, SqlTransaction, Boolean)
Public methodStatic memberDoInExistingTransactionT(DbContextActionWithResultT, SqlConnection, SqlTransaction, Boolean)
Public methodStatic memberDoInTransaction(DbContextActionWithNoResult, String)
Public methodStatic memberDoInTransactionT(DbContextActionWithResultT, String)
Public methodStatic memberDoInTransactionSavepoint(String, DbContextActionWithNoResult)
Public methodStatic memberDoInTransactionSavepointT(String, DbContextActionWithResultT)
Public methodStatic memberSafeRollback
Top
Extension Methods
  NameDescription
Public Extension MethodToBool
Converts object to boolean.
(Defined by ObjectExtensions.)
Public Extension MethodToDateTime
Converts object to DateTime.
(Defined by ObjectExtensions.)
Public Extension MethodToInt
Converts object to integer.
(Defined by ObjectExtensions.)
Top
See Also