#ctor ()
Initializes a new instance of the DAL class and opens the database connection.
#ctor ( connection, providerName, isolationLevel, parameterMarker, namedParameters )
Initializes a new instance of the DAL class and opens the database connection.
| Name | Type | Description |
|---|
| connection | System.Data.Common.DbConnection | An instance of a database connection. |
| providerName | System.String | The database provider name. e.g. System.Data.SqlClient (default). |
| isolationLevel | System.Data.IsolationLevel | The isolation level of the transaction. |
| parameterMarker | System.Nullable{System.Char} | The character used to designate parameters. If omitted an attempt is made to get the parameter marker from the database schema. Defaults to @ when it is not found in the schema. |
| namedParameters | System.Nullable{System.Boolean} | A value indicating whether named parameters are supported by the database provider. If ommited an attempt is made to define named parameter support from the database schema. |
#ctor ( connection, providerName, isolationLevel, parameterMarker, namedParameters )
Initializes a new instance of the DAL class and opens the database connection.
| Name | Type | Description |
|---|
| connection | System.String | The Connection string. |
| providerName | System.String | The database provider name. e.g. System.Data.SqlClient (default). |
| isolationLevel | System.Data.IsolationLevel | The isolation level of the transaction. |
| parameterMarker | System.Nullable{System.Char} | The character used to designate parameters. If omitted an attempt is made to get the parameter marker from the database schema. Defaults to @ when it is not found in the schema. |
| namedParameters | System.Nullable{System.Boolean} | A value indicating whether named parameters are supported by the database provider. If ommited an attempt is made to define named parameter support from the database schema. |
AddCatalog ( types, catalogName, schemaName, serverName )
Adds the catalog for the specified types.
| Name | Type | Description |
|---|
| types | System.Collections.Generic.List{System.Type} | - |
| catalogName | System.String | - |
| schemaName | System.String | - |
| serverName | System.String | - |
AddCatalog ( type, catalogName, schemaName, serverName )
Adds the catalog for the specified type.
| Name | Type | Description |
|---|
| type | System.Type | - |
| catalogName | System.String | - |
| schemaName | System.String | - |
| serverName | System.String | - |
AddKeyDataRow ( rows, columnName, keyRows )
Adds the key data row with the specified column name to the list of key rows.
| Name | Type | Description |
|---|
| rows | System.Collections.Generic.List{System.Data.DataRow} | - |
| columnName | System.String | - |
| keyRows | System.Collections.Generic.List{System.Data.DataRow} | - |
AddParameterMarker ( name )
Adds the parameter marker to the specified parameter name.
| Name | Type | Description |
|---|
| name | System.String | - |
ReturnsThe parameter name with marker.
AddToCollection ( reader, type, parent, treeName, tableName, columnName, rlTypes, list, listSet )
Adds the object to the specified list.
| Name | Type | Description |
|---|
| reader | System.Data.Common.DbDataReader | - |
| type | System.Type | - |
| parent | Componyx.Data.DAL.Relation | - |
| treeName | System.String | - |
| tableName | System.String | - |
| columnName | System.String | - |
| rlTypes | System.Collections.Generic.Dictionary{System.String,System.String} | - |
| list | System.Collections.IList | - |
| listSet | System.Collections.Generic.HashSet{System.Object} | - |
BeginTransaction ()
Begins a transaction and keeps track of new commands within the current transaction.
ClearCatalogs ()
Removes all catalogs.
CloseReader ()
Closes the global data reader.
CommitChanges ( obj, deep, refreshModel, parentType, parentKeyInfoList )
Commit changes.
| Name | Type | Description |
|---|
| obj | System.Object | - |
| deep | System.Boolean | - |
| refreshModel | System.Boolean | - |
| parentType | System.Boolean | - |
| parentKeyInfoList | System.Type | - |
CommitChangesAsync ( obj, deep, refreshModel, existenceCheck, parentType, parentKeyInfoList )
Commits the changes.
| Name | Type | Description |
|---|
| obj | System.Object | - |
| deep | System.Boolean | - |
| refreshModel | System.Boolean | - |
| existenceCheck | System.Boolean | - |
| parentType | System.Type | - |
| parentKeyInfoList | System.Collections.Generic.List{Componyx.Data.DAL.KeyInfo} | - |
CommitDelete ( obj, deep )
Deletes the object.
| Name | Type | Description |
|---|
| obj | System.Object | - |
| deep | System.Boolean | - |
CommitDeleteAsync ( obj, deep )
Deletes the object.
| Name | Type | Description |
|---|
| obj | System.Object | - |
| deep | System.Boolean | - |
CommitTransaction ()
Keeps track of the commands within the current transaction and commits the transaction after the last command.
CreateClass ( reader, type, parent, treeName, rlTypes, list, listSet )
Creates a new class instance of the specified type and fills it from the data reader.
| Name | Type | Description |
|---|
| reader | System.Data.Common.DbDataReader | - |
| type | System.Type | - |
| parent | Componyx.Data.DAL.Relation | - |
| treeName | System.String | - |
| rlTypes | System.Collections.Generic.Dictionary{System.String,System.String} | - |
| list | System.Collections.IList | - |
| listSet | System.Collections.Generic.HashSet{System.Object} | - |
CreateColumns<T> ( tableData, obj, deep, parentType, parentKeyInfoList, keyInfoList, childs )
Creates insert/update columns.
| Name | Type | Description |
|---|
| tableData | Componyx.Data.DAL.TableData | - |
| obj | <T> | - |
| deep | System.Boolean | - |
| parentType | System.Type | - |
| parentKeyInfoList | System.Collections.Generic.List{Componyx.Data.DAL.KeyInfo} | - |
| keyInfoList | System.Collections.Generic.List{Componyx.Data.DAL.KeyInfo} | - |
| childs | System.Collections.Generic.List{System.Object} | - |
CreateCommand ()
Creates a new command for the current database provider.
ReturnsThe command object instance
CreateCommand ( text, parameters, timeout, type )
Creates a new command for the current database provider.
| Name | Type | Description |
|---|
| text | System.String | - |
| parameters | System.Collections.Generic.List{System.Data.IDataParameter} | - |
| timeout | System.Nullable{System.Int32} | - |
| type | System.Nullable{System.Data.CommandType} | - |
ReturnsThe command object instance
CreateDeleteCommand ( obj, type, tableData, deep, childs )
Creates the delete command.
| Name | Type | Description |
|---|
| obj | System.Object | - |
| type | System.Type | - |
| tableData | Componyx.Data.DAL.TableData | - |
| deep | System.Boolean | - |
| childs | System.Collections.Generic.List{System.Object} | - |
CreateExistsCommand ( tableData, cmd, columns )
Creates the exists command.
| Name | Type | Description |
|---|
| tableData | Componyx.Data.DAL.TableData | - |
| cmd | System.Data.Common.DbCommand | - |
| columns | System.Collections.Generic.Dictionary{System.String,System.Data.IDataParameter} | - |
CreateInsertCommand ( type, tableData, columns )
Creates the insert command.
| Name | Type | Description |
|---|
| type | System.Type | - |
| tableData | Componyx.Data.DAL.TableData | - |
| columns | System.Collections.Generic.Dictionary{System.String,System.Data.IDataParameter} | - |
CreateJoins ( type, parent, loadOneToMany, loadOneToOne, columns, tables, treeName, tableAliasMapping, rlTypes, rlTableData, rlKeyInfoList, rlTableAlias, oneToManyRelation, occurredTypes )
Creates the table joins for the load method.
| Name | Type | Description |
|---|
| type | System.Type | - |
| parent | Componyx.Data.DAL.Relation | - |
| loadOneToMany | System.Boolean | - |
| loadOneToOne | System.Boolean | - |
| columns | System.Collections.Generic.List{System.String} | - |
| tables | System.Collections.Generic.List{System.String} | - |
| treeName | System.String | - |
| tableAliasMapping | System.Collections.Generic.Dictionary{System.String,System.String} | - |
| rlTypes | System.Collections.Generic.HashSet{System.String} | - |
| rlTableData | Componyx.Data.DAL.TableData | - |
| rlKeyInfoList | System.Collections.Generic.List{Componyx.Data.DAL.KeyInfo} | - |
| rlTableAlias | System.Int32 | - |
| oneToManyRelation | System.Boolean | - |
| occurredTypes | System.Collections.Generic.Dictionary{System.String,System.Int32} | - |
CreateParameter ( cmd, name, value, direction )
Creates a new parameter for the current database provider.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | - |
| name | System.String | - |
| value | System.Object | - |
| direction | System.Nullable{System.Data.ParameterDirection} | - |
ReturnsThe parameter name.
CreateParameter ( name, value, direction, type )
Creates a new parameter for the current database provider.
| Name | Type | Description |
|---|
| name | System.String | - |
| value | System.Object | - |
| direction | System.Nullable{System.Data.ParameterDirection} | - |
| type | System.Nullable{System.Data.DbType} | - |
ReturnsThe parameter object instance
CreateSelectCommand ( tableData, columns, where, id )
Creates the select command.
| Name | Type | Description |
|---|
| tableData | Componyx.Data.DAL.TableData | - |
| columns | System.Collections.Generic.Dictionary{System.String,System.Data.IDataParameter} | - |
| where | System.String | - |
| id | System.Nullable{System.Int64} | - |
CreateUpdateCommand ( type, tableData, columns, where )
Creates the update command.
| Name | Type | Description |
|---|
| type | System.Type | - |
| tableData | Componyx.Data.DAL.TableData | - |
| columns | System.Collections.Generic.Dictionary{System.String,System.Data.IDataParameter} | - |
| where | System.String | - |
DefaultSchemaFilter ( row, type, tableName )
Filters the schema rows on server, catalog and table name.
| Name | Type | Description |
|---|
| row | System.Data.DataRow | - |
| type | System.Type | - |
| tableName | System.String | - |
Delete ( obj, deep, globalTransaction )
Deletes the object's corresponding record from the database table.
| Name | Type | Description |
|---|
| obj | System.Object | Object to save. |
| deep | System.Boolean | Delete child objects. |
| globalTransaction | System.Boolean | Defines if a global transaction is used to remove the object and it's child objects. |
DeleteAsync ( obj, deep, globalTransaction )
Deletes the object's corresponding record from the database table.
| Name | Type | Description |
|---|
| obj | System.Object | Object to save. |
| deep | System.Boolean | Delete child objects. |
| globalTransaction | System.Boolean | Defines if a global transaction is used to remove the object and it's child objects. |
DeleteSet<T> ( list, deep, globalTransaction )
Deletes the object's corresponding records from the database table.
| Name | Type | Description |
|---|
| list | System.Collections.IEnumerable | List of objects to save. |
| deep | System.Boolean | Delete child objects. |
| globalTransaction | System.Boolean | Defines if a global transaction is used to remove the object and it's child objects. |
DeleteSetAsync<T> ( list, deep, globalTransaction )
Deletes the object's corresponding records in the database table.
| Name | Type | Description |
|---|
| list | System.Collections.IEnumerable | List of objects to save. |
| deep | System.Boolean | Delete child objects. |
| globalTransaction | System.Boolean | Defines if a global transaction is used to store and refresh the object and it's child objects. |
Dispose ()
Disposes the dal.
Escape ( name )
| Name | Type | Description |
|---|
| name | System.String | - |
FindFKColumnName ( properties, type, propertyName, columnName, treeName )
Finds the foreignkey column in the property list of the data relation.
| Name | Type | Description |
|---|
| properties | System.Collections.Generic.List{System.Reflection.PropertyInfo} | - |
| type | System.Type | - |
| propertyName | System.String | - |
| columnName | System.String | - |
| treeName | System.String | - |
ReturnsThe foreignkey column name.
GetColumnName ( property )
Gets the column name for the specified property.
| Name | Type | Description |
|---|
| property | System.Reflection.PropertyInfo | - |
GetFKAttributes ( property )
Gets a list of ForeignKey attributes for the specified property.
| Name | Type | Description |
|---|
| property | System.Reflection.PropertyInfo | - |
GetKeyFields ( type, useColumnAttribute )
Gets the key fields for the specified type.
| Name | Type | Description |
|---|
| type | System.Type | - |
| useColumnAttribute | System.Boolean | - |
GetOrdinal ( treeName, tableName, columnName, isClass )
Retrieves the column ordinal.
| Name | Type | Description |
|---|
| treeName | System.String | - |
| tableName | System.String | - |
| columnName | System.String | - |
| isClass | System.Boolean | - |
GetParameterMarker ()
GetParameterNameMaxLength ()
GetPropertyName<T> ( propertyExpression )
Gets the name of an instance property from a property access lambda.
| Name | Type | Description |
|---|
| propertyExpression | System.Linq.Expressions.Expression{System.Func{<T>}} | Lambda expression in the form: '() => Class.Property'. |
ReturnsThe name of the property.
GetPropertyNames ( propertyExpressions )
Gets the name of an instance property from a property access lambda.
| Name | Type | Description |
|---|
| propertyExpressions | System.Collections.Generic.List{System.Linq.Expressions.Expression{System.Func{System.Object}}} | A list of Lambda expression in the form: '() => Class.Property'. |
ReturnsThe name of the property.
GetPropInfo ( property )
Gets (and caches) property information.
| Name | Type | Description |
|---|
| property | System.Reflection.PropertyInfo | - |
GetSchemaKeyData ( reader, type, treeName )
Gets unique key data for the specified type.
| Name | Type | Description |
|---|
| reader | System.Data.Common.DbDataReader | - |
| type | System.Type | - |
| treeName | System.String | - |
GetSchemaTable ( tableName )
Gets the column metadata for the specified table.
| Name | Type | Description |
|---|
| tableName | System.String | - |
ReturnsA DataTable that describes the column metadata of the specified table.
GetSchemaTableData ( type, typeSchema, treeName )
Gets schema table data for the specified type.
| Name | Type | Description |
|---|
| type | System.Type | - |
| typeSchema | System.Boolean | - |
| treeName | System.String | - |
GetTableName ( type )
Gets the table name for the specified type.
| Name | Type | Description |
|---|
| type | System.Type | - |
GetValue ( reader, type, parentType, treeName, tableName, columnName, isClass )
Gets the value from the reader.
| Name | Type | Description |
|---|
| reader | System.Data.Common.DbDataReader | - |
| type | System.Type | - |
| parentType | System.Type | - |
| treeName | System.String | - |
| tableName | System.String | - |
| columnName | System.String | - |
| isClass | System.Boolean | - |
HandleError ()
HasIdentity ( tableData )
Checks if the table has an identity column.
| Name | Type | Description |
|---|
| tableData | Componyx.Data.DAL.TableData | - |
HasType ( types, type )
Checks if the type is in the specified types set.
| Name | Type | Description |
|---|
| types | System.Collections.Generic.HashSet{System.Type} | - |
| type | System.Type | - |
IncludeCatalog ( type, tableName )
Prefixes the catalog name to the table name if there is a catalog mapped for the specified type.
| Name | Type | Description |
|---|
| type | System.Type | - |
| tableName | System.String | - |
Init ( isolationLevel, parameterMarker, namedParameters )
Initializes the DAL.
| Name | Type | Description |
|---|
| isolationLevel | System.Data.IsolationLevel | - |
| parameterMarker | System.Nullable{System.Char} | - |
| namedParameters | System.Nullable{System.Boolean} | - |
InitFactory ( providerName, connection )
Init DB Factory.
| Name | Type | Description |
|---|
| providerName | System.String | - |
| connection | System.String | - |
InitQuery ()
Initializes a new query.
Insert ( obj, columns, where, refreshModel )
Inserts the object.
| Name | Type | Description |
|---|
| obj | System.Object | - |
| columns | System.Collections.Generic.Dictionary{System.String,System.Data.IDataParameter} | - |
| where | System.String | - |
| refreshModel | System.Boolean | - |
InsertAsync ( obj, columns, where, refreshModel )
Inserts the object.
| Name | Type | Description |
|---|
| obj | System.Object | - |
| columns | System.Collections.Generic.Dictionary{System.String,System.Data.IDataParameter} | - |
| where | System.String | - |
| refreshModel | System.Boolean | - |
IsMapped ( property )
Checks if the property is mapped.
| Name | Type | Description |
|---|
| property | System.Reflection.PropertyInfo | - |
IsMapped ( type )
Checks if the type is mapped.
| Name | Type | Description |
|---|
| type | System.Type | - |
ReturnsA value indicating if the type is mapped.
IsNumeric ( type )
Checks if property type is numeric
| Name | Type | Description |
|---|
| type | System.Type | - |
IsReadOnly ( property )
Checks if the property is DB read-only.
| Name | Type | Description |
|---|
| property | System.Reflection.PropertyInfo | - |
LimitResult ( cmd, skip, take )
Limit result for flat query.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | - |
| skip | System.Int32 | - |
| take | System.Int32 | - |
LimitResult<T> ( cmd, skip, take )
Limit result for query of known type.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | - |
| skip | System.Int32 | - |
| take | System.Int32 | - |
Load<T> ( obj, loadOneToMany, loadOneToOne, sortOrder )
Loads and fills the object with the retrieved data from the corresponding database record.
| Name | Type | Description |
|---|
| obj | <T> | - |
| loadOneToMany | System.Boolean | A value indicating if one-to-many relations of the target type should be loaded. |
| loadOneToOne | System.Boolean | A value indicating if one-to-one relations of the target type should be loaded. |
| sortOrder | System.Collections.Generic.List{System.Collections.Generic.KeyValuePair{System.String,System.Boolean}} | The sort order by specifying a KeyValuePair with the property name as key and a boolean value to indicate if the sort order is ascending(false) or descending(true). |
ReturnsThe loaded object.
LoadAsync<T> ( obj, loadOneToMany, loadOneToOne, sortOrder )
Loads and fills the object with the retrieved data from the corresponding database record.
| Name | Type | Description |
|---|
| obj | <T> | - |
| loadOneToMany | System.Boolean | A value indicating if one-to-many relations of the target type should be loaded. |
| loadOneToOne | System.Boolean | A value indicating if one-to-one relations of the target type should be loaded. |
| sortOrder | System.Collections.Generic.List{System.Collections.Generic.KeyValuePair{System.String,System.Boolean}} | The sort order by specifying a KeyValuePair with the property name as key and a boolean value to indicate if the sort order is ascending(false) or descending(true). |
ReturnsThe loaded object.
NonQuery ( cmd )
Executes a query and returns the number of rows affected.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | - |
NonQueryAsync ( cmd )
Executes a query and returns the number of rows affected.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | - |
OpenAsync ( connection, providerName, isolationLevel, parameterMarker, namedParameters )
Opens the database connection async.
| Name | Type | Description |
|---|
| connection | System.Data.Common.DbConnection | An instance of a database connection. |
| providerName | System.String | The database provider name. e.g. System.Data.SqlClient (default). |
| isolationLevel | System.Data.IsolationLevel | The isolation level of the transaction. |
| parameterMarker | System.Nullable{System.Char} | The character used to designate parameters. If omitted an attempt is made to get the parameter marker from the database schema. Defaults to @ when it is not found in the schema. |
| namedParameters | System.Nullable{System.Boolean} | A value indicating whether named parameters are supported by the database provider. If ommited an attempt is made to define named parameter support from the database schema. |
OpenAsync ( connection, providerName, isolationLevel, parameterMarker, namedParameters )
Opens the database connection async.
| Name | Type | Description |
|---|
| connection | System.String | The Connection string. |
| providerName | System.String | The database provider name. e.g. System.Data.SqlClient (default). |
| isolationLevel | System.Data.IsolationLevel | The isolation level of the transaction. |
| parameterMarker | System.Nullable{System.Char} | The character used to designate parameters. If omitted an attempt is made to get the parameter marker from the database schema. Defaults to @ when it is not found in the schema. |
| namedParameters | System.Nullable{System.Boolean} | A value indicating whether named parameters are supported by the database provider. If ommited an attempt is made to define named parameter support from the database schema. |
PagedResult ( cmd, pageIndex )
Limit query result by page index for flat query.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | - |
| pageIndex | System.Nullable{System.Int32} | - |
PagedResult<T> ( cmd, pageIndex )
Limit query result by page index for query of known type.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | - |
| pageIndex | System.Nullable{System.Int32} | - |
Query ( type, cmd )
Executes the query command.
| Name | Type | Description |
|---|
| type | System.Type | - |
| cmd | System.Data.Common.DbCommand | - |
Query<T> ( loadOneToMany, loadOneToOne )
Creates a new instance of the FluentQuery class to build a query with fluent syntax.
| Name | Type | Description |
|---|
| loadOneToMany | System.Boolean | A value indicating if one-to-many relations of the target type should be loaded. |
| loadOneToOne | System.Boolean | A value indicating if one-to-one relations of the target type should be loaded. |
ReturnsA FluentQueryT class.
Query<T> ( cmd, pageIndex )
Executes a query and returns the result as a list of T.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | The command object. |
| pageIndex | System.Nullable{System.Int32} | The page index. |
QueryAsDataSet ( cmd, pageIndex )
Executes a query and returns the result as a dataset.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | Command object. |
| pageIndex | System.Nullable{System.Int32} | The page index. |
QueryAsDataSetAsync ( cmd, pageIndex )
Executes a query and returns the result as a dataset.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | Command object. |
| pageIndex | System.Nullable{System.Int32} | The page index. |
QueryAsReader ( cmd, pageIndex )
Executes a query and returns the result as DbDataReader.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | The command object. |
| pageIndex | System.Nullable{System.Int32} | The page index. |
ReturnsAn DbDataReader object.
QueryAsReaderAsync ( cmd, pageIndex )
Executes a query and returns the result as DbDataReader.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | The command object. |
| pageIndex | System.Nullable{System.Int32} | The page index. |
ReturnsAn DbDataReader object.
QueryAsync ( type, cmd )
Quer
| Name | Type | Description |
|---|
| type | System.Type | - |
| cmd | System.Data.Common.DbCommand | - |
QueryAsync<T> ( cmd, pageIndex )
Executes a query and returns the result as a list of T.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | The command object. |
| pageIndex | System.Nullable{System.Int32} | The page index. |
RefreshModel ( original, updated )
Refreshes the data model.
| Name | Type | Description |
|---|
| original | System.Object | - |
| updated | System.Object | - |
RemoveCatalog ( types )
Removes the catalog for the specified types.
| Name | Type | Description |
|---|
| types | System.Collections.Generic.List{System.Type} | - |
RemoveCatalog ( type )
Removes the catalog for the specified type.
| Name | Type | Description |
|---|
| type | System.Type | - |
Save ( ds, selectCmd )
Saves the dataset's corresponding records in the database.
| Name | Type | Description |
|---|
| ds | System.Data.DataSet | - |
| selectCmd | System.Data.Common.DbCommand | - |
Save ( obj, deep, refreshModel, globalTransaction )
Saves the object's corresponding record in the database table.
| Name | Type | Description |
|---|
| obj | System.Object | Object to save. |
| deep | System.Boolean | Save child objects. |
| refreshModel | System.Boolean | Defines if the object model is refreshed after saving. |
| globalTransaction | System.Boolean | Defines if a global transaction is used to store and refresh the object and it's child objects. |
SaveAsync<T> ( obj, deep, refreshModel, globalTransaction )
Saves the object's corresponding record in the database table, inserting new records and updating existing ones.
| Name | Type | Description |
|---|
| obj | <T> | Object to save. |
| deep | System.Boolean | Save child objects. |
| refreshModel | System.Boolean | Defines if the object model is refreshed after saving. |
| globalTransaction | System.Boolean | Defines if a global transaction is used to store and refresh the object and it's child objects. |
SaveBatchAsync<T> ( items, globalTransaction )
Inserts a batch of new records into the database asynchronously without checking for existing records. Faster than SaveSetAsync<T> for scenarios where records are guaranteed to be new, such as after a table truncate. Does not support storing child objects or refreshing models after saving.
| Name | Type | Description |
|---|
| items | System.Collections.IEnumerable | List of new objects to insert. |
| globalTransaction | System.Boolean | Defines if a global transaction is used for all inserts. |
SaveSet<T> ( items, deep, refreshModel, globalTransaction )
Saves a collection of objects to the database asynchronously, inserting new records and updating existing ones.
| Name | Type | Description |
|---|
| items | System.Collections.IEnumerable | List of objects to save. |
| deep | System.Boolean | Save child objects. |
| refreshModel | System.Boolean | Defines if the object model is refreshed after saving. |
| globalTransaction | System.Boolean | Defines if a global transaction is used to store and refresh the object and it's child objects. |
SaveSetAsync<T> ( items, deep, refreshModel, globalTransaction )
Saves a collection of objects to the database asynchronously, inserting new records and updating existing ones.
| Name | Type | Description |
|---|
| items | System.Collections.IEnumerable | List of objects to save. |
| deep | System.Boolean | Whether to also save child objects. |
| refreshModel | System.Boolean | Whether to refresh the object model after saving, updating properties such as generated identity values. |
| globalTransaction | System.Boolean | Defines if a global transaction is used for all saves. |
Scalar<T> ( cmd )
Executes a query and returns the result as T.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | Command object. |
ScalarAsync<T> ( cmd )
Executes a query and returns the result as T.
| Name | Type | Description |
|---|
| cmd | System.Data.Common.DbCommand | Command object. |
SplitOrderBy ( orderByClause )
Handles splitting of the ORDER BY clause, avoiding commas inside function calls like JSON_VALUE(column, property).
| Name | Type | Description |
|---|
| orderByClause | System.String | - |
StoreSchemaColumns ( schema )
Stores the columns from the schema table for quick access.
| Name | Type | Description |
|---|
| schema | System.Data.DataTable | - |
TableInSchema ( type )
Checks if the table is part of the current schema.
| Name | Type | Description |
|---|
| type | System.Type | - |
Update ( obj, columns, where, refreshModel )
Updates the object.
| Name | Type | Description |
|---|
| obj | System.Object | - |
| columns | System.Collections.Generic.Dictionary{System.String,System.Data.IDataParameter} | - |
| where | System.String | - |
| refreshModel | System.Boolean | - |
UpdateAsync ( obj, columns, where, refreshModel )
Updates the object.
| Name | Type | Description |
|---|
| obj | System.Object | - |
| columns | System.Collections.Generic.Dictionary{System.String,System.Data.IDataParameter} | - |
| where | System.String | - |
| refreshModel | System.Boolean | - |
UpdateKeyValues ( obj, keyInfoList, properties )
Update key values after insert because the table could have an auto increment identity
| Name | Type | Description |
|---|
| obj | System.Object | - |
| keyInfoList | System.Collections.Generic.List{Componyx.Data.DAL.KeyInfo} | - |
| properties | System.Collections.Generic.List{System.Reflection.PropertyInfo} | - |
Where<T> ( propertyExpression, openGroups, loadOneToMany, loadOneToOne )
Creates a new instance of the FluentQuery class to build a query with fluent syntax and initializes the where clause.
| Name | Type | Description |
|---|
| propertyExpression | System.Linq.Expressions.Expression{System.Func{System.Object}} | Lambda expression of the form: '() => Class.Property'. |
| openGroups | System.Int32 | Count of groups to open |
| loadOneToMany | System.Boolean | A value indicating if one-to-many relations of the target type should be loaded. |
| loadOneToOne | System.Boolean | A value indicating if one-to-one relations of the target type should be loaded. |
ReturnsA FluentQueryT class.
Where<T> ( propertyName, openGroups, loadOneToMany, loadOneToOne )
Creates a new instance of the FluentQuery class to build a query with fluent syntax and initializes the where clause.
| Name | Type | Description |
|---|
| propertyName | System.String | The property name of the root class, dot separated tree name for parent/child classes or empty if a filter is not required. |
| openGroups | System.Int32 | Count of groups to open |
| loadOneToMany | System.Boolean | A value indicating if one-to-many relations of the target type should be loaded. |
| loadOneToOne | System.Boolean | A value indicating if one-to-one relations of the target type should be loaded. |
ReturnsA FluentQueryT class.