Click or drag to resize

TableOperationsT Class

Defines database operations for a modeled table.
Inheritance Hierarchy
SystemObject
  GSF.Data.ModelTableOperationsT

Namespace: GSF.Data.Model
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax
public class TableOperations<T> : ITableOperations
where T : class, new()
View Source

Type Parameters

T
Modeled table.

The TableOperationsT type exposes the following members.

Constructors
 NameDescription
Public methodTableOperationsT(AdoDataConnection, IEnumerableKeyValuePairString, String) Creates a new TableOperationsT.
Public methodTableOperationsT(AdoDataConnection, ActionException, IEnumerableKeyValuePairString, String) Creates a new TableOperationsT using provided exceptionHandler.
Top
Properties
 NameDescription
Public propertyApplyRootQueryRestrictionToDeletes Gets or sets flag that determines if RootQueryRestriction should be applied to delete operations.
Public propertyApplyRootQueryRestrictionToUpdates Gets or sets flag that determines if RootQueryRestriction should be applied to update operations.
Public propertyConnection Gets AdoDataConnection instance associated with this TableOperationsT used for database operations.
Public propertyExceptionHandler Gets or sets delegate used to handle table operation exceptions.
Public propertyHasPrimaryKeyIdentityField Gets flag that determines if modeled table has a primary key that is an identity field.
Public propertyPrimaryKeyCache Gets or sets primary key cache.
Public propertyRootQueryRestriction Gets or sets root record restriction that applies to query table operations.
Public propertyTableName Gets the table name defined for the modeled table, includes any escaping as defined in model.
Public propertyStatic memberTypeRegistry Gets or sets TypeRegistry instance used for evaluating encountered instances of the ValueExpressionAttributeBase on modeled table properties.
Public propertyUnescapedTableName Gets the table name defined for the modeled table without any escape characters.
Public propertyUseCaseSensitiveFieldNames Gets or sets flag that determines if field names should be treated as case sensitive. Defaults to false.
Top
Methods
 NameDescription
Public methodAddNewOrUpdateRecord Adds the specified modeled table record to the database if the record has not defined any of its primary key values; otherwise, the database will be updated with the specified modeled table record.
Public methodAddNewRecord(DataRow) Adds the specified row to the database.
Public methodAddNewRecord(T) Adds the specified modeled table record to the database.
Public methodApplyRecordDefaults Applies the default values on the specified modeled table record where any of the properties are marked with either DefaultValueAttribute or DefaultValueExpressionAttribute.
Public methodStatic memberApplyRecordDefaultsFunction Gets a delegate for the ApplyRecordDefaults(T) method for specified type T.
Public methodApplyRecordUpdates Applies the update values on the specified modeled table record where any of the properties are marked with UpdateValueExpressionAttribute.
Public methodStatic memberApplyRecordUpdatesFunction Gets a delegate for the ApplyRecordUpdates(T) method for specified type T.
Public methodClearPrimaryKeyCache Clears the primary key cache for this TableOperationsT instance.
Public methodDeleteRecord(DataRow) Deletes the record referenced by the specified row.
Public methodDeleteRecord(Object) Deletes the record referenced by the specified primaryKeys.
Public methodDeleteRecord(T) Deletes the specified modeled table record from the database.
Public methodDeleteRecord(RecordRestriction, NullableBoolean) Deletes the records referenced by the specified restriction.
Public methodDeleteRecordWhere Deletes the records referenced by the specified SQL filter expression and parameters.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodFieldHasAttribute(String, Type) Determines if the specified field has an associated attribute.
Public methodFieldHasAttributeTAttribute(String) Determines if the specified field has an associated attribute.
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 methodGetFieldNames Gets the field names for the table; if escaped is true, also includes any escaping as defined in model.
Public methodGetFieldType Gets the Type for the specified field.
Public methodGetFieldValue Gets the value for the specified field.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetInterpretedFieldValue Gets the interpreted value for the specified field, encrypting or returning any intermediate IDbDataParameter value as needed.
Public methodGetPageOfRecords Gets the specified page of records from the provided source records array.
Public methodGetPrimaryKeyCacheSize Calculates the size of the current primary key cache, in number of records.
Public methodGetPrimaryKeyFieldNames Get the primary key field names for the table; if escaped is true, also includes any escaping as defined in model.
Public methodGetPrimaryKeys(DataRow) Gets the primary key values from the specified row.
Public methodGetPrimaryKeys(T) Gets the primary key values from the specified record.
Public methodGetSearchRestriction Generates a RecordRestriction based on fields marked with SearchableAttribute and specified searchText.
Public methodStatic memberGetTableName Gets table name for model applying model attributes TableNameAttribute, ConfigFileTableNamePrefixAttribute, and UseEscapedNameAttribute
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodIsSearchMatch(T, String) Determines if any record fields modeled with the SearchableAttribute match any of the specified searchValues.
Public methodIsSearchMatch(T, StringComparison, String) Determines if any record fields modeled with the SearchableAttribute match any of the specified searchValues.
Public methodLoadRecord(DataRow) Creates a new modeled table record queried from the specified row.
Public methodLoadRecord(Object) Creates a new modeled table record queried from the specified primaryKeys.
Public methodStatic memberLoadRecordFunction Gets a delegate for the LoadRecord(DataRow) function for specified type T.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodNewRecord Creates a new modeled record instance, applying any modeled default values as specified by a DefaultValueAttribute or DefaultValueExpressionAttribute on the model properties.
Public methodStatic memberNewRecordFunction Gets a delegate for the NewRecord function for specified type T.
Public methodQueryRecord(RecordRestriction) Queries database and returns a single modeled table record for the specified restriction.
Public methodQueryRecord(String, RecordRestriction) Queries database and returns a single modeled table record for the specified restriction, execution of query will apply orderByExpression.
Public methodQueryRecordCount(RecordRestriction) Gets the record count for the specified restriction - or - total record count for the modeled table if restriction is null.
Public methodQueryRecordCount(String) Gets the record count for the modeled table based on search parameter. Search executed against fields modeled with SearchableAttribute.
Public methodQueryRecordCountWhere Gets the record count for the modeled table for the specified SQL filter expression and parameters.
Public methodQueryRecords(RecordRestriction) Queries database and returns modeled table records for the specified restriction.
Public methodQueryRecords(String, RecordRestriction, Int32) Queries database and returns modeled table records for the specified parameters.
Public methodQueryRecords(String, Boolean, Int32, Int32, RecordRestriction) Queries database and returns modeled table records for the specified sorting and paging parameters.
Public methodQueryRecords(String, Boolean, Int32, Int32, String) Queries database and returns modeled table records for the specified sorting, paging and search parameters. Search executed against fields modeled with SearchableAttribute.
Public methodQueryRecordsWhere Queries database and returns modeled table records for the specified SQL filter expression and parameters.
Public methodQueryRecordWhere Queries database and returns a single modeled table record for the specified SQL filter expression and parameters.
Public methodSearchRecords Locally searches retrieved table records after queried from database for the specified sorting and search parameters. Search executed against fields modeled with SearchableAttribute. Function only typically used for record models that apply the EncryptDataAttribute.
Public methodToDataTable Converts the given collection of records into a DataTable.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodTryGetFieldAttribute(String, Type, Attribute) Attempts to get the specified attributeType for a field.
Public methodTryGetFieldAttributeTAttribute(String, TAttribute) Attempts to get the specified attribute for a field.
Public methodUpdateRecord(DataRow, RecordRestriction) Updates the database with the specified row, any model properties marked with UpdateValueExpressionAttribute will be evaluated and applied before the record is provided to the data source.
Public methodUpdateRecord(T, RecordRestriction, NullableBoolean) Updates the database with the specified modeled table record, any model properties marked with UpdateValueExpressionAttribute will be evaluated and applied before the record is provided to the data source.
Public methodUpdateRecordWhere(DataRow, String, Object) Updates the database with the specified row referenced by the specified SQL filter expression and parameters, any model properties marked with UpdateValueExpressionAttribute will be evaluated and applied before the record is provided to the data source.
Public methodUpdateRecordWhere(T, String, Object) Updates the database with the specified modeled table record referenced by the specified SQL filter expression and parameters, any model properties marked with UpdateValueExpressionAttribute will be evaluated and applied before the record is provided to the data source.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
See Also