GetDataFromDatabase<T>(string, IDatabase, IQueryGenerator, List<string>, PropertyEqualityComparer<T>, FilterCallback<T>) Method
Retrieves data from a database for a specified table, columns, and data contract type.
Namespace
DbSyncKit.DB.Fetcher
Containing Type
DataContractFetcher

Syntax

public HashSet<T> GetDataFromDatabase<T>(string tableName, IDatabase connection, IQueryGenerator manager, List<string> columns, PropertyEqualityComparer<T> ComparablePropertyEqualityComparer, FilterCallback<T> filterCallback)

Remarks

The method generates a SELECT query using the provided query generation manager and executes it using a DatabaseManager. The resulting data is converted to a HashSet using the specified property equality comparer for data comparison. The retrieved data can be optionally filtered using the provided filter callback function.

Type Parameters

Name Description
T The type of data entities to retrieve.

Parameters

Name Type Description
tableName string The name of the table from which to retrieve data.
connection IDatabase The database connection.
manager IQueryGenerator The query generation manager for creating the SELECT query.
columns List<string> A list of column names to retrieve from the table.
ComparablePropertyEqualityComparer PropertyEqualityComparer<T> An equality comparer for identifying properties used in data comparison.
filterCallback FilterCallback<T> A callback function for filtering the retrieved data.

Return Value

Type Description
HashSet<T> A HashSet of data entities of type T retrieved from the specified table and columns in the database.