Click or drag to resize

ITableOperationsSearchRecords Method

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.

Namespace: GSF.Data.Model
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
Object[] SearchRecords(
	string sortField,
	bool ascending,
	string searchText,
	StringComparison comparison = StringComparison.OrdinalIgnoreCase
)
View Source

Parameters

sortField  String
Field name to order-by.
ascending  Boolean
Sort ascending flag; set to false for descending.
searchText  String
Text to search.
comparison  StringComparison  (Optional)
StringComparison to use when searching string fields; defaults to ordinal ignore case.

Return Value

Object
An array of modeled table row instances for the queried records that match the search.
Remarks

This function searches records locally after query from database, this way SearchableAttribute functionality will work even with fields that are modeled with the EncryptDataAttribute and use the LikeExpression. Primary keys for this function will not be cached server-side and this function will be slower and more expensive than similar calls to QueryRecords(String, Boolean, Int32, Int32, String). Usage should be restricted to cases searching for field data that has been modeled with the EncryptDataAttribute.

This function does not paginate records, instead a full list of search records is returned. User can cache returned records and page through them using the GetPageOfRecords(Object, Int32, Int32) function. As a result, usage should be restricted to smaller data sets.

See Also