Click or drag to resize

DataContext Class

Data context functions for the execution of query data
Inheritance Hierarchy
SystemObject
  SanteDB.OrmLiteDataContext
    SanteDB.OrmLiteReaderWriterLockingDataContext

Namespace: SanteDB.OrmLite
Assembly: SanteDB.OrmLite (in SanteDB.OrmLite.dll) Version: 3.0.2081-alpha+d0a78774d3f97b9193d2ae2fef6d129ea9f29519
Syntax
public class DataContext : IDisposable

The DataContext type exposes the following members.

Constructors
 NameDescription
Public methodDataContext(IDbProvider, IDbConnection) Creates a new data context
Public methodDataContext(IDbProvider, IDbConnection, Boolean) Creates a new data context
Public methodDataContext(IDbProvider, IDbConnection, IDbTransaction) Creates a new data context
Top
Properties
 NameDescription
Public propertyCommandTimeout Overrides the command timeout for any command executed on this data context
Public propertyConnection Connection
Public propertyContextId Gets or sets the context id
Public propertyData Temporary lookup values used during this context's use
Public propertyIsReadonly True if the connection is readonly
Public propertyTransaction Current Transaction
Top
Methods
 NameDescription
Public methodAny(SqlStatement) Represents the count function
Public methodAnyTModel(ExpressionFuncTModel, Boolean) Returns only if only one result is available
Public methodBeginTransaction Begin a transaction
Public methodClose Close the connection however don't dispose
Public methodCount(SqlStatement) Represents the count function
Public methodCountTModel(ExpressionFuncTModel, Boolean) Returns only if only one result is available
Public methodCreateSqlStatementBuilder(SqlStatement) Create sql statement
Public methodCreateSqlStatementBuilder(String, Object) Create sql statement
Public methodCreateTableTTable Create a table
Public methodDeleteTModel Delete from the database
Public methodDeleteAll(Type, SqlStatement) Delete from the database
Public methodDeleteAll(Type, LambdaExpression) Update all
Public methodDeleteAllTModel(ExpressionFuncTModel, Boolean) Delete from the database
Public methodDeleteAllTModel(SqlStatement) Update all with specified Sql based statement
Public methodDisableConstraints Instructs the provider to disable constraints (such as foreign keys, check constraints, etc.)
Public methodDispose Dispose this object
Public methodDropTableTTable Create a table
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodExecQueryTModel Executes the query against the database
Public methodExecuteNonQuery(SqlStatement) Execute a non query
Public methodExecuteNonQuery(String, Object) Execute the specified SQL
Public methodExecuteProcedureTModel First or default returns only the first object or null if not found
Public methodExecuteScalarTReturn Returns only if only one result is available
Public methodExists(Type, Guid) Determines if modelKey of type type exists in the database
Public methodExistsTModel(TModel) Determines if obj exists in the database
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodFirstOrDefault(Type, SqlStatement) First or default returns only the first object or null if not found
Public methodFirstOrDefaultTModel(ExpressionFuncTModel, Boolean) First or default returns only the first object or null if not found
Public methodFirstOrDefaultTModel(SqlStatement) First or default returns only the first object or null if not found
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetQueryBuilder Query builder
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodInsertTModel Insert the specified object
Public methodInsertAllTModel Bulk insert data
Public methodInsertOrUpdateTModel INSERT OR IGNORE the specifed object
Public methodInsertOrUpdateAllTModel Bulk insert data
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodOpen Open the connection to the database
Public methodQuery(Type, SqlStatement) Non-generic implementation for query
Public methodQueryTModel(ExpressionFuncTModel, Boolean) Execute the specified query
Public methodQueryTModel(SqlStatement) Query using the specified statement
Public methodQueryTModel(String, Object) Execute a stored procedure transposing the result set back to TModel
Public methodRestoreConstraints Instructs the provider to enable constraints (such as foreign keys, check constraints, etc.)
Public methodSingleOrDefaultTModel Returns only if only one result is available
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodUpdateTModel Updates the specified object
Public methodUpdateAll(Type, SqlStatement, LambdaExpression) Update all data with specified where clause
Public methodUpdateAll(Type, LambdaExpression, LambdaExpression) Update all
Public methodUpdateAllTModel(IEnumerableTModel) Bulk update data
Public methodUpdateAllTModel(ExpressionFuncTModel, Boolean, ExpressionFuncTModel, Object) Updates the specified object
Public methodUpdateAllTModel(IEnumerableTModel, FuncTModel, TModel) Bulk update data
Public methodUpdateAllTModel(SqlStatement, ExpressionFuncTModel, Object) Update all with specified Sql based statement
Public methodUpdateAllTModel, TUpdateModel(ExpressionFuncTModel, Boolean, ExpressionFuncTUpdateModel, Object) Update all data matching whereExpression to updateStatements
Top
Events
 NameDescription
Public eventDisposed Fired when the connection is disposed
Top
Extension Methods
 NameDescription
Public Extension MethodAddOrUpdateData Adds or updates data on the context
(Defined by DataContextExtensions)
Public Extension MethodContainsStackEntry Returns true if the data stack contains an entry
(Defined by DataContextExtensions)
Public Extension MethodConvertTReturn The purpose of this method is to convert object me to TReturn. Why? Because if you have an instance of Act that actually needs to be a SubstanceAdministration we can't just cast so we have to copy.
(Defined by ExtensionMethods)
Public Extension MethodCreateInformationModelGuard Should be called when converting to information model to prevent stack overflows
(Defined by DataContextExtensions)
Public Extension MethodEstablishProvenance Establish a provenance entry for the specified connection
(Defined by DataContextExtensions)
Public Extension MethodGetProvenance Get provenance from the context
(Defined by DataContextExtensions)
Public Extension MethodInstall Install the specified object
(Defined by SqlFeatureUtil)
Public Extension MethodIsInstalled Returns true if the migration has been installed
(Defined by SqlFeatureUtil)
Public Extension MethodIsLoadingInformationModel Determine if the information model is loading
(Defined by DataContextExtensions)
Public Extension MethodPeekData Set data on the context in a safe manner
(Defined by DataContextExtensions)
Public Extension MethodPopData Set data on the context in a safe manner
(Defined by DataContextExtensions)
Public Extension MethodPushData Set data on the context in a safe manner
(Defined by DataContextExtensions)
Public Extension MethodShouldDisableObjectValidation Should disable object validation
(Defined by DataContextExtensions)
Public Extension MethodValidateMaximumStackDepth Validate that the current context is under the maximum stack depth
(Defined by DataContextExtensions)
Public Extension MethodWithControl With control parameter is used as a wrapper for _ parameters
(Defined by QueryFilterExtensions)
Top
See Also