Class Search
Describes the data required to run a search
Inherited Members
Namespace: Benday.Common
Assembly: Benday.Common.dll
Syntax
public class Search
Constructors
| Edit this page View SourceSearch()
Declaration
public Search()
Properties
| Edit this page View SourceArguments
Search arguments and values for those arguments
Declaration
public List<SearchArgument> Arguments { get; }
Property Value
| Type | Description |
|---|---|
| List<SearchArgument> |
MaxNumberOfResults
Maximum number of items in the result
Declaration
public int MaxNumberOfResults { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Name
Name of the search to run. (Empty string or null string is the default.)
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Sorts
Description of how the result should be sorted
Declaration
public List<SortBy> Sorts { get; set; }
Property Value
| Type | Description |
|---|---|
| List<SortBy> |
Methods
| Edit this page View SourceAddArgument(string, SearchMethod, int, SearchOperator)
Add a search argument
Declaration
public void AddArgument(string propertyName, SearchMethod method, int value, SearchOperator combineWithOtherArgumentsAs = SearchOperator.And)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyName | Name of the search argument or property name |
| SearchMethod | method | Type of search operator for this argument |
| int | value | Value for this search argument |
| SearchOperator | combineWithOtherArgumentsAs | Describes how this argument is combined with other arguments: Or and And |
AddArgument(string, SearchMethod, string, SearchOperator)
Add a search argument
Declaration
public void AddArgument(string propertyName, SearchMethod method, string value, SearchOperator combineWithOtherArgumentsAs = SearchOperator.And)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyName | Name of the search argument or property name |
| SearchMethod | method | Type of search operator for this argument |
| string | value | Value for this search argument |
| SearchOperator | combineWithOtherArgumentsAs | Describes how this argument is combined with other arguments: Or and And |
AddSort(string, string)
Add a sort directive for the results of the search
Declaration
public void AddSort(string sortByPropertyName, string direction = "ascending")
Parameters
| Type | Name | Description |
|---|---|---|
| string | sortByPropertyName | Name of the result property to order by |
| string | direction | Ascending or descending |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | |
| ArgumentOutOfRangeException |