Click or drag to resize

DataContext Class

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

Namespace:  SanteDB.OrmLite
Assembly:  SanteDB.OrmLite (in SanteDB.OrmLite.dll) Version: 2.2.1
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 propertyCacheOnCommit
Cache on commit
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
Data dictionary
Public propertyIsReadonly
True if the connection is readonly
Public propertyLoadState
Load state
Public propertyTransaction
Current Transaction
Top
Methods
  NameDescription
Public methodAddCacheCommit
Add cache commit
Public methodAddData
Adds data in a safe way
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 methodCount(SqlStatement)
Represents the count function
Public methodCountTModel(ExpressionFuncTModel, Boolean)
Returns only if only one result is available
Public methodCreateSqlStatement
Create sql statement
Public methodCreateSqlStatement(String, Object)
Create sql statement
Public methodCreateSqlStatementT
Create SQL statement
Public methodDeleteTModel(TModel)
Delete from the database
Public methodDeleteTModel(ExpressionFuncTModel, Boolean)
Delete from the database
Public methodDeleteTModel(SqlStatement)
Delete from the database
Public methodDispose
Dispose this object
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExecQueryTModel
Executes the query against the database
Public methodExecuteNonQuery
Execute a non query
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 methodExistsTModel
Determines if obj exists in the database
Protected methodFinalize
Allows 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 methodGetCacheCommit
Add cache commit
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetQueryBuilder
Query builder
Public methodGetQueryLiteral
Query
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInsertTModel
Insert the specified object
Public methodInsertAllTModel
Bulk insert data
Public methodInsertOrUpdateTModel
Insert or update the specifed object
Public methodInsertOrUpdateAllTModel
Bulk insert data
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOpen
Open the connection to the database
Public methodOpenClonedContext
Opens a cloned context
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 methodResetSequence
Resets the specified sequence according to the logic in the provider
Public methodSingleOrDefaultTModel
Returns only if only one result is available
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdateTModel(TModel)
Updates the specified object
Public methodUpdateTModel(IEnumerableTModel, FuncTModel, TModel)
Bulk update data
Public methodUpdateAllTModel
Bulk update data
Top
Extension Methods
  NameDescription
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 MethodGetInstanceOfTDomain
Gets an instance of TDomain from me
(Defined by ModelExtensions.)
Public Extension MethodInstall
Install the specified object
(Defined by SqlFeatureUtil.)
Public Extension MethodIsInstalled
Returns true if the migration has been installed
(Defined by SqlFeatureUtil.)
Top
See Also