Show / Hide Table of Contents

Class Search

Describes the data required to run a search

Inheritance
object
Search
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Benday.Common
Assembly: Benday.Common.dll
Syntax
public class Search

Constructors

| Edit this page View Source

Search()

Declaration
public Search()

Properties

| Edit this page View Source

Arguments

Search arguments and values for those arguments

Declaration
public List<SearchArgument> Arguments { get; }
Property Value
Type Description
List<SearchArgument>
| Edit this page View Source

MaxNumberOfResults

Maximum number of items in the result

Declaration
public int MaxNumberOfResults { get; set; }
Property Value
Type Description
int
| Edit this page View Source

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
| Edit this page View Source

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 Source

AddArgument(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

| Edit this page View Source

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

| Edit this page View Source

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
  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com