alexa
Syncfusion
menu Syncfusion

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class QueryableExtensions

    Inheritance
    object
    QueryableExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Maui.DataSource.Extensions
    Assembly: Syncfusion.Maui.DataSource.dll
    Syntax
    [RequiresUnreferencedCode("The QueryableExtensions is not trim compatible")]
    [RequiresDynamicCode("This method relies on dynamic code generation.")]
    public static class QueryableExtensions

    Methods

    AndAlsoPredicate(Expression, Expression)

    Generates an ANDAlso binary expression for the given expressions.

    Declaration
    public static BinaryExpression AndAlsoPredicate(this Expression expression1, Expression expression2)
    Parameters
    Type Name Description
    Expression expression1

    The expression 1.

    Expression expression2

    The expression 2.

    Returns
    Type Description
    BinaryExpression

    An ANDAlso binary expression for the given expressions.

    AndPredicate(Expression, Expression)

    Generates an AND binary expression for the given Binary expressions.

    Declaration
    public static BinaryExpression AndPredicate(this Expression expression1, Expression expression2)
    Parameters
    Type Name Description
    Expression expression1

    Represents the expression1.

    Expression expression2

    Represents the expression2.

    Returns
    Type Description
    BinaryExpression

    Returns the binary expression.

    Average(IQueryable, string)

    Calculates the average by executing the expression obtained from the queryable average method based on the given source and the property name.

    Declaration
    public static object Average(this IQueryable source, string propertyName)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Returns
    Type Description
    object

    The average by executing the expression obtained from the queryable average method based on the given source and the property name.

    Average(IQueryable, string, Expression<Func<string, object, object>>)

    Calculates the average by executing the expression obtained from the queryable average method based on the given source, property name and the expression function.

    Declaration
    public static object Average(this IQueryable source, string propertyName, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Expression<Func<string, object, object>> expressionFunc

    The expression function.

    Returns
    Type Description
    object

    The average by executing the expression obtained from the queryable average method based on the given source, property name and the expression function.

    Average(IQueryable, string, Type)

    Calculates the average by executing the expression obtained from the queryable average method based on the given source and the property name.

    Declaration
    public static object Average(this IQueryable source, string propertyName, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Type sourceType

    The source type.

    Returns
    Type Description
    object

    The average by executing the expression obtained from the queryable average method based on the given source and the property name.

    Count(IQueryable)

    Gets the execution times count of the given queryable source.

    Declaration
    public static int Count(this IQueryable source)
    Parameters
    Type Name Description
    IQueryable source

    The source which is to be queried.

    Returns
    Type Description
    int

    The count of the execution times of the given queryable source.

    ElementAt(IQueryable, int)

    Gets the element at the given index and the source.

    Declaration
    public static object ElementAt(this IQueryable source, int index)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    int index

    The index at which the element is to be obtained.

    Returns
    Type Description
    object

    The element at the given index and the source.

    ElementAt(IQueryable, int, Type)

    Gets the element at the given index and the source.

    Declaration
    public static object ElementAt(this IQueryable source, int index, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    int index

    The index at which the element is to be obtained.

    Type sourceType

    The type of the source.

    Returns
    Type Description
    object

    The element at the given index and the source.

    ElementAtOrDefault(IQueryable, int)

    Gets the element at or default of the given index and the source.

    Declaration
    public static object ElementAtOrDefault(this IQueryable source, int index)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    int index

    The index at which the element is to be obtained.

    Returns
    Type Description
    object

    The element at the given index and the source.

    ElementAtOrDefault(IQueryable, int, Type)

    Gets the element at or default of the given index and the source.

    Declaration
    public static object ElementAtOrDefault(this IQueryable source, int index, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    int index

    The index at which the element is to be obtained.

    Type sourceType

    The type of the source.

    Returns
    Type Description
    object

    The element at or default of the given index and the type of source.

    Equal(ParameterExpression, string, object)

    Generates the equal expression for the given parameter expression, property and value.

    Declaration
    public static Expression Equal(this ParameterExpression parameterExpression, string propertyName, object value)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression based on which the expression is generated.

    string propertyName

    The property name for which the expression is to be generated.

    object value

    The object.

    Returns
    Type Description
    Expression

    The equal expression for the given parameter expression, property and value.

    Equal(ParameterExpression, string, object, Type, Expression<Func<string, object, object>>)

    Generates an equal expression for the given values.

    Declaration
    public static Expression Equal(this ParameterExpression parameterExpression, string propertyName, object value, Type elementType, Expression<Func<string, object, object>> expressionFunction)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name for which the expression is generated.

    object value

    The object.

    Type elementType

    The type of the element.

    Expression<Func<string, object, object>> expressionFunction

    The expression function.

    Returns
    Type Description
    Expression

    An equal expression for the given values.

    Equal(ParameterExpression, string, string)

    Generates an equal binary expression for the given expression and the property name.

    Declaration
    public static BinaryExpression Equal(this ParameterExpression parameterExpression, string propertyName, string propertyName2)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression for generating the binary expression.

    string propertyName

    The property name 1.

    string propertyName2

    The property name 2.

    Returns
    Type Description
    BinaryExpression

    An equal binary expression for the given expression and the property name.

    GetExpression(ParameterExpression, string)

    Gets the expression for the given property and the parameter expression.

    Declaration
    public static Expression GetExpression(this ParameterExpression parameterExpression, string propertyName)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression based on which the expression is generated.

    string propertyName

    The property name for which the expression is to be generated.

    Returns
    Type Description
    Expression

    The expression for the given property and the parameter expression.

    GetObjectType(IQueryable)

    Gets the type of the given source.

    Declaration
    public static Type GetObjectType(this IQueryable source)
    Parameters
    Type Name Description
    IQueryable source

    The source, whose type is to be obtained.

    Returns
    Type Description
    Type

    The type of the given object.

    GetValueExpression(ParameterExpression, string, Type)

    Generate expression from simple and complex property

    Declaration
    public static Expression GetValueExpression(this ParameterExpression parameterExpression, string propertyName, Type sourceType)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    Represents the parameter expression.

    string propertyName

    Represents the property name.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    Expression

    Returns the expression.

    GreaterThan(ParameterExpression, string, object)

    Generates a GreaterThan binary expression for the given parameter expression, property and the value.

    Declaration
    public static BinaryExpression GreaterThan(this ParameterExpression parameterExpression, string propertyName, object value)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name.

    object value

    The object.

    Returns
    Type Description
    BinaryExpression

    A GreaterThan binary expression for the given parameter expression, property and the value.

    GreaterThan(ParameterExpression, string, object, Type, Expression<Func<string, object, object>>)

    Generates a GreaterThan expression for the given values.

    Declaration
    public static Expression GreaterThan(this ParameterExpression parameterExpression, string propertyName, object value, Type elementType, Expression<Func<string, object, object>> expressionFunction)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name.

    object value

    The object.

    Type elementType

    The element type.

    Expression<Func<string, object, object>> expressionFunction

    The expression function.

    Returns
    Type Description
    Expression

    A GreaterThan expression for the given values.

    GreaterThan(ParameterExpression, string, string)

    Generates a GreaterThan binary expression for the given expression and the property.

    Declaration
    public static BinaryExpression GreaterThan(this ParameterExpression parameterExpression, string propertyName, string propertyName2)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name 1.

    string propertyName2

    The property name 2.

    Returns
    Type Description
    BinaryExpression

    A GreaterThan binary expression for the given values.

    GreaterThanOrEqual(ParameterExpression, string, object)

    Generates a GreaterThanOrEqual binary expression for the given expression, property and the value.

    Declaration
    public static BinaryExpression GreaterThanOrEqual(this ParameterExpression parameterExpression, string propertyName, object value)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name.

    object value

    The object.

    Returns
    Type Description
    BinaryExpression

    A GreaterThanOrEqual binary expression for the given expression, property and the value.

    GreaterThanOrEqual(ParameterExpression, string, object, Type, Expression<Func<string, object, object>>)

    Generates a GreaterThanOrEqual binary expression for the given values.

    Declaration
    public static Expression GreaterThanOrEqual(this ParameterExpression parameterExpression, string propertyName, object value, Type elementType, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name.

    object value

    The object.

    Type elementType

    The element type.

    Expression<Func<string, object, object>> expressionFunc

    The expression function.

    Returns
    Type Description
    Expression

    A GreaterThanOrEqual binary expression for the given values.

    GreaterThanOrEqual(ParameterExpression, string, string)

    Generates a GreaterThanOrEqual binary expression for the given expressions and the property.

    Declaration
    public static BinaryExpression GreaterThanOrEqual(this ParameterExpression parameterExpression, string propertyName, string propertyName2)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name 1.

    string propertyName2

    The property name 2.

    Returns
    Type Description
    BinaryExpression

    A GreaterThanOrEqual binary expression for the given expressions and the property.

    GroupBy(IQueryable, IEnumerable<SortColumn>)

    Gets the GroupBy query expression for the given source and enumerable collection of the sort columns.

    Declaration
    public static IQueryable GroupBy(this IQueryable source, IEnumerable<SortColumn> groupByNames)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    IEnumerable<SortColumn> groupByNames

    The enumerable collection of the sort columns group by names.

    Returns
    Type Description
    IQueryable

    The GroupBy query expression for the given source and enumerable collection of the sort columns.

    GroupBy(IQueryable, IEnumerable<SortColumn>, Type)

    Gets the GroupBy query expression for the given source and enumerable collection of the sort columns.

    Declaration
    public static IQueryable GroupBy(this IQueryable source, IEnumerable<SortColumn> groupByNames, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    IEnumerable<SortColumn> groupByNames

    The enumerable collection of the sort columns group by names.

    Type sourceType

    The type of the source.

    Returns
    Type Description
    IQueryable

    The GroupBy query expression for the given source and enumerable collection of the sort columns.

    GroupBy(IQueryable, string, string)

    Gets the GroupBy query expression for the given source, group name and sort action.

    Declaration
    public static IQueryable GroupBy(this IQueryable source, string groupByName, string sortAction)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string groupByName

    The group by name which is the property name.

    string sortAction

    The sort action.

    Returns
    Type Description
    IQueryable

    The GroupBy query expression for the given source, group name and sort action.

    GroupBy(IQueryable, string, string, Type)

    Generates the GroupBy Expression

    Declaration
    public static IQueryable GroupBy(this IQueryable source, string groupByName, string sortAction, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string groupByName

    Represents the group name.

    string sortAction

    Represents the sort action.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns queryable objects.

    GroupByMany(IEnumerable, Type, List<SortDescriptor>, Dictionary<string, IComparer<object>>, Func<string, Expression>, params string[])

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany(this IEnumerable source, Type sourceType, List<SortDescriptor> sortFields, Dictionary<string, IComparer<object>> sortComparers, Func<string, Expression> getExpressionFunc, params string[] properties)
    Parameters
    Type Name Description
    IEnumerable source

    The IEnumerable source.

    Type sourceType

    The type of the source.

    List<SortDescriptor> sortFields

    The list of sort descriptions.

    Dictionary<string, IComparer<object>> sortComparers

    The dictionary of sort comparers.

    Func<string, Expression> getExpressionFunc

    The expression function.

    string[] properties

    The array of properties.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given values.

    GroupByMany(IEnumerable, Type, List<SortDescriptor>, Func<string, Expression>, params string[])

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany(this IEnumerable source, Type sourceType, List<SortDescriptor> sortFields, Func<string, Expression> getExpressionFunc, params string[] properties)
    Parameters
    Type Name Description
    IEnumerable source

    The IEnumerable source.

    Type sourceType

    The type of the source.

    List<SortDescriptor> sortFields

    The list of sort descriptions.

    Func<string, Expression> getExpressionFunc

    The expression function.

    string[] properties

    The array of properties.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given values.

    GroupByMany(IEnumerable, Type, Func<string, Expression>, params string[])

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany(this IEnumerable source, Type sourceType, Func<string, Expression> getExpressionFunc, params string[] properties)
    Parameters
    Type Name Description
    IEnumerable source

    The IQueryable source.

    Type sourceType

    The type of the source.

    Func<string, Expression> getExpressionFunc

    The expression function.

    string[] properties

    The array of properties.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given values.

    GroupByMany(IQueryable, Dictionary<string, string>, params string[])

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany(this IQueryable source, Dictionary<string, string> formatCollection, params string[] properties)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    Dictionary<string, string> formatCollection

    The dictionary of format collection.

    string[] properties

    The array of properties.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection for the given values.

    GroupByMany(IQueryable, Dictionary<string, string>, Type, params string[])

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany(this IQueryable source, Dictionary<string, string> formatCollection, Type sourceType, params string[] properties)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    Dictionary<string, string> formatCollection

    The dictionary of format collection.

    Type sourceType

    The type of the source.

    string[] properties

    The array of properties.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given values.

    GroupByMany(IQueryable, IEnumerable<string>)

    Generates the GroupResult enumerable collection based on the given source and the properties passed.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany(this IQueryable source, IEnumerable<string> properties)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source

    IEnumerable<string> properties

    The enumerable collection of properties.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given source and the properties passed.

    GroupByMany(IQueryable, params string[])

    Generates the GroupResult enumerable collection for the given source and the properties passed.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany(this IQueryable source, params string[] properties)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string[] properties

    The array of properties.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection for the given source and the properties passed.

    GroupByMany(IQueryable, Type, List<SortDescriptor>, params string[])

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany(this IQueryable source, Type sourceType, List<SortDescriptor> sortFields, params string[] properties)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    Type sourceType

    The type of the source.

    List<SortDescriptor> sortFields

    The list of sort descriptions.

    string[] properties

    The array of properties.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given values.

    GroupByMany(IQueryable, Type, params string[])

    Generates the GroupResult enumerable collection based on the given source and the properties.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany(this IQueryable source, Type sourceType, params string[] properties)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source

    Type sourceType

    The type of the source.

    string[] properties

    The array of properties.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given source and the properties.

    GroupByMany<TElement>(IEnumerable<TElement>, IEnumerable<Func<TElement, object>>)

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany<TElement>(this IEnumerable<TElement> elements, IEnumerable<Func<TElement, object>> groupSelectors)
    Parameters
    Type Name Description
    IEnumerable<TElement> elements

    The enumerable collection of the elements.

    IEnumerable<Func<TElement, object>> groupSelectors

    The enumerable collection of function for the group selectors.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given values.

    Type Parameters
    Name Description
    TElement

    The type parameter.

    GroupByMany<TElement>(IEnumerable<TElement>, List<SortDescriptor>, Dictionary<string, IComparer<object>>, List<string>, params Func<TElement, object>[])

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany<TElement>(this IEnumerable<TElement> elements, List<SortDescriptor> sortFields, Dictionary<string, IComparer<object>> sortComparers, List<string> properties, params Func<TElement, object>[] groupSelectors)
    Parameters
    Type Name Description
    IEnumerable<TElement> elements

    The enumerable collection of the elements.

    List<SortDescriptor> sortFields

    The list of sort descriptions.

    Dictionary<string, IComparer<object>> sortComparers

    The sort comparers collection.

    List<string> properties

    The array of properties.

    Func<TElement, object>[] groupSelectors

    The function for the group selectors.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given values.

    Type Parameters
    Name Description
    TElement

    The type parameter.

    GroupByMany<TElement>(IEnumerable<TElement>, List<SortDescriptor>, Dictionary<string, IComparer<object>>, string[], IEnumerable<Func<TElement, object>>)

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany<TElement>(this IEnumerable<TElement> elements, List<SortDescriptor> sortFields, Dictionary<string, IComparer<object>> sortComparers, string[] properties, IEnumerable<Func<TElement, object>> groupSelectors)
    Parameters
    Type Name Description
    IEnumerable<TElement> elements

    The enumerable collection of the elements.

    List<SortDescriptor> sortFields

    The list of sort descriptions.

    Dictionary<string, IComparer<object>> sortComparers

    The sort comparers collection.

    string[] properties

    The array of properties.

    IEnumerable<Func<TElement, object>> groupSelectors

    The enumerable collection of the function for the group selectors.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given values.

    Type Parameters
    Name Description
    TElement

    The type of the elements.

    GroupByMany<TElement>(IEnumerable<TElement>, List<SortDescriptor>, IEnumerable<Func<TElement, object>>)

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany<TElement>(this IEnumerable<TElement> elements, List<SortDescriptor> sortFields, IEnumerable<Func<TElement, object>> groupSelectors)
    Parameters
    Type Name Description
    IEnumerable<TElement> elements

    The enumerable collection of the elements.

    List<SortDescriptor> sortFields

    The list of sort descriptions.

    IEnumerable<Func<TElement, object>> groupSelectors

    The enumerable collection of the function for the group selectors.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given values.

    Type Parameters
    Name Description
    TElement

    The type of the elements.

    GroupByMany<TElement>(IEnumerable<TElement>, List<SortDescriptor>, params Func<TElement, object>[])

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany<TElement>(this IEnumerable<TElement> elements, List<SortDescriptor> sortFields, params Func<TElement, object>[] groupSelectors)
    Parameters
    Type Name Description
    IEnumerable<TElement> elements

    The enumerable collection of the elements.

    List<SortDescriptor> sortFields

    The list of sort descriptions.

    Func<TElement, object>[] groupSelectors

    The function for the group selectors.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given values.

    Type Parameters
    Name Description
    TElement

    The type of the elements.

    GroupByMany<TElement>(IEnumerable<TElement>, params Func<TElement, object>[])

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany<TElement>(this IEnumerable<TElement> elements, params Func<TElement, object>[] groupSelectors)
    Parameters
    Type Name Description
    IEnumerable<TElement> elements

    The enumerable collection of the elements.

    Func<TElement, object>[] groupSelectors

    The function for the group selectors.

    Returns
    Type Description
    IEnumerable<GroupResult>

    The GroupResult enumerable collection based on the given values.

    Type Parameters
    Name Description
    TElement

    The type of the elements.

    GroupByMany<TElement>(IEnumerable, Type, List<Func<TElement, object>>)

    Generates the GroupResult enumerable collection based on the given values.

    Declaration
    public static IEnumerable<GroupResult> GroupByMany<TElement>(this IEnumerable source, Type sourceType, List<Func<TElement, object>> groupKeySelectors)
    Parameters
    Type Name Description
    IEnumerable source

    The enumerable collection of the elements.

    Type sourceType

    The type of the source.

    List<Func<TElement, object>> groupKeySelectors

    The function for the group selectors.

    Returns
    Type Description
    IEnumerable<GroupResult>

    Returns the enumerable collection.

    Type Parameters
    Name Description
    TElement

    The type parameter.

    LessThan(ParameterExpression, string, object)

    Generates a LessThan binary expression for the given expression, property and the values.

    Declaration
    public static BinaryExpression LessThan(this ParameterExpression parameterExpression, string propertyName, object value)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name.

    object value

    The object.

    Returns
    Type Description
    BinaryExpression

    A LessThan binary expression for the given expression, property and the values.

    LessThan(ParameterExpression, string, object, Type, Expression<Func<string, object, object>>)

    Generates a LessThan expression for the given values.

    Declaration
    public static Expression LessThan(this ParameterExpression parameterExpression, string propertyName, object value, Type elementType, Expression<Func<string, object, object>> expressionFunction)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name.

    object value

    The object.

    Type elementType

    The element type.

    Expression<Func<string, object, object>> expressionFunction

    The expression function.

    Returns
    Type Description
    Expression

    A LessThan expression for the given values.

    LessThan(ParameterExpression, string, string)

    Generates a LessThan binary expression for the given expression and the property.

    Declaration
    public static BinaryExpression LessThan(this ParameterExpression parameterExpression, string propertyName, string propertyName2)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name 1.

    string propertyName2

    The property name 2.

    Returns
    Type Description
    BinaryExpression

    A LessThan binary expression for the given expression and the property.

    LessThanOrEqual(ParameterExpression, string, object)

    Generates a LessThanOrEqual binary expression for the given expression, property and the value.

    Declaration
    public static BinaryExpression LessThanOrEqual(this ParameterExpression parameterExpression, string propertyName, object value)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name.

    object value

    The object.

    Returns
    Type Description
    BinaryExpression

    A LessThanOrEqual binary expression for the given expression, property and the value.

    LessThanOrEqual(ParameterExpression, string, object, Type, Expression<Func<string, object, object>>)

    Generates a LessThanOrEqual expression for the given values.

    Declaration
    public static Expression LessThanOrEqual(this ParameterExpression parameterExpression, string propertyName, object value, Type elementType, Expression<Func<string, object, object>> expressionFunction)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name.

    object value

    The object.

    Type elementType

    The element type.

    Expression<Func<string, object, object>> expressionFunction

    The expression function.

    Returns
    Type Description
    Expression

    A LessThanOrEqual expression for the given values.

    LessThanOrEqual(ParameterExpression, string, string)

    Generates a LessThanOrEqual binary expression for the given expression and property.

    Declaration
    public static BinaryExpression LessThanOrEqual(this ParameterExpression parameterExpression, string propertyName, string propertyName2)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name 1.

    string propertyName2

    The property name 2.

    Returns
    Type Description
    BinaryExpression

    A LessThanOrEqual binary expression for the given expression and property.

    Max(IQueryable, string)

    Calculates the max object by executing the expression obtained from the queryable max method based on the given source and the property name.

    Declaration
    public static object Max(this IQueryable source, string propertyName)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Returns
    Type Description
    object

    The max object by executing the expression obtained from the queryable max method based on the given source and the property name.

    Max(IQueryable, string, Expression<Func<string, object, object>>)

    Calculates the max object by executing the expression obtained from the queryable max method based on the given values.

    Declaration
    public static object Max(this IQueryable source, string propertyName, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Expression<Func<string, object, object>> expressionFunc

    The expression function.

    Returns
    Type Description
    object

    The max object by executing the expression obtained from the queryable max method based on the given values.

    Max(IQueryable, string, Type)

    Calculates the max object by executing the expression obtained from the queryable max method based on the given source and the property name.

    Declaration
    public static object Max(this IQueryable source, string propertyName, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Type sourceType

    The source type.

    Returns
    Type Description
    object

    The max object by executing the expression obtained from the queryable max method based on the given source and the property name.

    Min(IQueryable, string)

    Calculates the min object by executing the expression obtained from the queryable min method based on the given source and the property.

    Declaration
    public static object Min(this IQueryable source, string propertyName)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Returns
    Type Description
    object

    The min object by executing the expression obtained from the queryable min method based on the given source and the property.

    Min(IQueryable, string, Expression<Func<string, object, object>>)

    Calculates the min object by executing the expression obtained from the queryable min method based on the given values.

    Declaration
    public static object Min(this IQueryable source, string propertyName, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Expression<Func<string, object, object>> expressionFunc

    The expression function.

    Returns
    Type Description
    object

    The min object by executing the expression obtained from the queryable min method based on the given values.

    Min(IQueryable, string, Type)

    Calculates the min object by executing the expression obtained from the queryable min method based on the given source and the property.

    Declaration
    public static object Min(this IQueryable source, string propertyName, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Type sourceType

    The source type.

    Returns
    Type Description
    object

    The min object by executing the expression obtained from the queryable min method based on the given source and the property.

    NotEqual(ParameterExpression, string, object)

    Generates a NotEqual binary expression for the given parameter expression, property and the value.

    Declaration
    public static BinaryExpression NotEqual(this ParameterExpression parameterExpression, string propertyName, object value)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name for which the expression is to be generated.

    object value

    The object.

    Returns
    Type Description
    BinaryExpression

    A NotEqual binary expression for the given parameter expression, property and the value.

    NotEqual(ParameterExpression, string, object, Type, Expression<Func<string, object, object>>)

    Generates a NotEqual expression for the given values.

    Declaration
    public static Expression NotEqual(this ParameterExpression parameterExpression, string propertyName, object value, Type elementType, Expression<Func<string, object, object>> expressionFunction)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name for which the expression is generated.

    object value

    The object.

    Type elementType

    The element type.

    Expression<Func<string, object, object>> expressionFunction

    The expression function.

    Returns
    Type Description
    Expression

    A NotEqual expression for the given values.

    NotEqual(ParameterExpression, string, string)

    Generates an NotEqual binary expression for the given expression and property.

    Declaration
    public static BinaryExpression NotEqual(this ParameterExpression parameterExpression, string propertyName, string propertyName2)
    Parameters
    Type Name Description
    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name 1.

    string propertyName2

    The property name 2.

    Returns
    Type Description
    BinaryExpression

    An NotEqual binary expression for the given expression and property.

    OfQueryable(IEnumerable)

    Determines the queryable which iterates over the given collection of items.

    Declaration
    public static IEnumerable OfQueryable(this IEnumerable items)
    Parameters
    Type Name Description
    IEnumerable items

    Represents the enumerable collection of items.

    Returns
    Type Description
    IEnumerable

    Returns the queryable which iterates over the given collection of items.

    OfQueryable(IEnumerable, Type)

    Determines the queryable which iterates over the given collection of items

    Declaration
    public static IEnumerable OfQueryable(this IEnumerable items, Type sourceType)
    Parameters
    Type Name Description
    IEnumerable items

    Represents the enumerable collection of items.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IEnumerable

    Returns the queryable which iterates over the given collection of items.

    OfType(IQueryable, Type)

    Gets the queryable expression OfType for the given source and its type.

    Declaration
    public static IQueryable OfType(this IQueryable source, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    Type sourceType

    The type of the source.

    Returns
    Type Description
    IQueryable

    The queryable expression OfType for the given source and its type.

    OfType<T, K>(ObservableCollection<K>)

    Gets the collection of the type parameter T for the given collection of type parameter K.

    Declaration
    public static ObservableCollection<T> OfType<T, K>(this ObservableCollection<K> items) where K : T
    Parameters
    Type Name Description
    ObservableCollection<K> items

    The collection of items.

    Returns
    Type Description
    ObservableCollection<T>

    The collection of the type parameter T for the given collection of type parameter K.

    Type Parameters
    Name Description
    T

    The target type parameter.

    K

    The given type parameter.

    OrElsePredicate(Expression, Expression)

    Generates an OrElse binary expression for the given expressions.

    Declaration
    public static BinaryExpression OrElsePredicate(this Expression expression1, Expression expression2)
    Parameters
    Type Name Description
    Expression expression1

    The expression 1.

    Expression expression2

    The expression 2.

    Returns
    Type Description
    BinaryExpression

    An OrElse binary expression for the given expressions.

    OrPredicate(Expression, Expression)

    Generates an OR binary expression for the given Binary expressions.

    Declaration
    public static BinaryExpression OrPredicate(this Expression expression1, Expression expression2)
    Parameters
    Type Name Description
    Expression expression1

    Represents the expression1.

    Expression expression2

    Represents the expression2.

    Returns
    Type Description
    BinaryExpression

    Returns the binary expression.

    OrderBy(IQueryable, ParameterExpression, Expression)

    Generates a OrderBy query for the Queryable source.

    Declaration
    public static IQueryable OrderBy(this IQueryable source, ParameterExpression parameterExpression, Expression expression)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    ParameterExpression parameterExpression

    Represents the parameter expression.

    Expression expression

    Represents the expression.

    Returns
    Type Description
    IQueryable

    Represents the queryable objects.

    OrderBy(IQueryable, string)

    Generates a OrderBy query for the Queryable source.

    Declaration
    public static IQueryable OrderBy(this IQueryable source, string propertyName)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string propertyName

    Represents the property name.

    Returns
    Type Description
    IQueryable

    Returns the queryable source.

    OrderBy(IQueryable, string, IComparer<object>, Expression<Func<string, object, object>>)

    Generates a OrderBy query for the Queryable source.

    Declaration
    public static IQueryable OrderBy(this IQueryable source, string propertyName, IComparer<object> comparer, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string propertyName

    Represents the property name.

    IComparer<object> comparer

    Represents the comparer object.

    Expression<Func<string, object, object>> expressionFunc

    Represents the expression function.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    OrderBy(IQueryable, string, IComparer<object>, Type)

    Generates an OrderBy query for the IComparer defined and queryable source.

    Declaration
    public static IQueryable OrderBy(this IQueryable source, string propertyName, IComparer<object> comparer, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string propertyName

    Represents the property name.

    IComparer<object> comparer

    Represents the comparer.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable source.

    OrderBy(IQueryable, string, Expression<Func<string, object, object>>)

    Generates a OrderBy query for the Queryable source.

    Declaration
    public static IQueryable OrderBy(this IQueryable source, string propertyName, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string propertyName

    Represents the property name.

    Expression<Func<string, object, object>> expressionFunc

    Represents the function expression.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    OrderBy(IQueryable, string, Type)

    Generates a OrderBy query for the Queryable source.

    DataClasses1DataContext db = new
    DataClasses1DataContext();
                var orders = db.Orders.Skip(0).Take(10).ToList();
                var queryable = orders.AsQueryable();
                var sortedOrders =
    queryable.OrderBy("ShipCountry");

    Declaration
    public static IQueryable OrderBy(this IQueryable source, string propertyName, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string propertyName

    Represents the property name.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    OrderByDescending(IQueryable, ParameterExpression, Expression)

    Generates the OrderByDescending query for the given source and expressions.

    Declaration
    public static IQueryable OrderByDescending(this IQueryable source, ParameterExpression parameterExpression, Expression expression)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    ParameterExpression parameterExpression

    The parameter expression which are the objects to populate to the parameter collection of the lambda expression.

    Expression expression

    The expression to set the lambda expression body property equals to.

    Returns
    Type Description
    IQueryable

    The OrderByDescending query for the given source and expressions.

    OrderByDescending(IQueryable, string)

    Generates the OrderByDescending query for the given source and the property.

    Declaration
    public static IQueryable OrderByDescending(this IQueryable source, string propertyName)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name for which the query is to be generated.

    Returns
    Type Description
    IQueryable

    The OrderByDescending query for the given source and the property.

    OrderByDescending(IQueryable, string, IComparer<object>, Expression<Func<string, object, object>>)

    Generates the OrderByDescending query for the given source, property, expression function and the comparer defined.

    Declaration
    public static IQueryable OrderByDescending(this IQueryable source, string propertyName, IComparer<object> comparer, Expression<Func<string, object, object>> expressionFunction)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name for which the query is to be generated.

    IComparer<object> comparer

    The comparer defined for the query.

    Expression<Func<string, object, object>> expressionFunction

    The expression function based on which the query is to be generated.

    Returns
    Type Description
    IQueryable

    Returns the queryable object.

    OrderByDescending(IQueryable, string, IComparer<object>, Type)

    Generates an OrderByDescending query for the IComparer and queryable source defined.

    Declaration
    public static IQueryable OrderByDescending(this IQueryable source, string propertyName, IComparer<object> comparer, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string propertyName

    Represents the property name.

    IComparer<object> comparer

    Represents the comparer objects.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    OrderByDescending(IQueryable, string, Expression<Func<string, object, object>>)

    Generates the OrderByDescending query for the given source, property and the expression function.

    Declaration
    public static IQueryable OrderByDescending(this IQueryable source, string propertyName, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name for which the query is to be generated.

    Expression<Func<string, object, object>> expressionFunc

    The expression function based on which the query is to be generated.

    Returns
    Type Description
    IQueryable

    The OrderByDescending query for the given source, property and the expression function.

    OrderByDescending(IQueryable, string, Type)

    Generates a OrderByDescending query for the Queryable source.

    DataClasses1DataContext db = new
    DataClasses1DataContext();
                var orders = db.Orders.Skip(0).Take(10).ToList();
                var queryable = orders.AsQueryable();
                var sortedOrders =
    queryable.OrderByDescending("ShipCountry");

    Declaration
    public static IQueryable OrderByDescending(this IQueryable source, string propertyName, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source

    string propertyName

    Represents the property name.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    OrderByDescending<T>(IQueryable, IComparer<T>)

    Generates an OrderByDescending query for the IComparer and queryable source defined.

    Declaration
    public static IQueryable OrderByDescending<T>(this IQueryable source, IComparer<T> comparer)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    IComparer<T> comparer

    Represents the comparer objects.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    Type Parameters
    Name Description
    T

    Represents the generic type parameter.

    OrderByDescending<T>(IQueryable, IComparer<T>, Type)

    Generates an OrderByDescending query for the IComparer defined.

    public class OrdersComparer :
             IComparer<Order>
                 {
                     public int Compare(Order x, Order y)
                     {
                         return string.Compare(x.ShipCountry, y.ShipCountry);
                     }
                 }

    var sortedOrders =
                db.Orders.Skip(0).Take(5).ToList().OrderByDescending(o => o, new
                OrdersComparer());
    Declaration
    public static IQueryable OrderByDescending<T>(this IQueryable source, IComparer<T> comparer, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source

    IComparer<T> comparer

    Represents the comparer.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    OrderBy<T>(IQueryable, IComparer<T>)

    Generates a OrderBy query for the Queryable source and Comparer.

    Declaration
    public static IQueryable OrderBy<T>(this IQueryable source, IComparer<T> comparer)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    IComparer<T> comparer

    Represents the comparer objects.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    Type Parameters
    Name Description
    T

    Represents the generic type parameter.

    OrderBy<T>(IQueryable, IComparer<T>, Type)

    Generates an OrderBy query for the IComparer defined.

    public class OrdersComparer :
             IComparer<Order>
                 {
                     public int Compare(Order x, Order y)
                     {
                         return string.Compare(x.ShipCountry, y.ShipCountry);
                     }
                 }

    var sortedOrders =
                db.Orders.Skip(0).Take(5).ToList().OrderBy(o => o, new
                OrdersComparer());
    Declaration
    public static IQueryable OrderBy<T>(this IQueryable source, IComparer<T> comparer, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The queryable source

    IComparer<T> comparer

    The comparer

    Type sourceType

    The queryable source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    Page(IQueryable, int, int)

    Generates the page expression for the given source, page index and page size.

    Declaration
    public static IQueryable Page(this IQueryable source, int pageIndex, int pageSize)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    int pageIndex

    The index of the page.

    int pageSize

    The size of the page.

    Returns
    Type Description
    IQueryable

    The page expression for the given source, page index and page size.

    Parameter(IQueryable)

    Creates a ParameterExpression that is required when building a series of predicates for the WHERE filter.

    DataClasses1DataContext db = new
        DataClasses1DataContext();
                var orders = db.Orders.Skip(0).Take(100).ToList();
                var queryable = orders.AsQueryable();
                var parameter =
        queryable.Parameter();

    Use this same parameter passed to generate different predicates and finally to generate the Lambda.

    Declaration
    public static ParameterExpression Parameter(this IQueryable source)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    Returns
    Type Description
    ParameterExpression

    Returns the parameter expression.

    Remarks

    If we specify a parameter for every predicate, then the Lambda expression scope will be out of the WHERE query that gets generated.

    Parameter(Type)

    Generates the parameter expression for the given source type.

    Declaration
    public static ParameterExpression Parameter(this Type sourceType)
    Parameters
    Type Name Description
    Type sourceType

    The source type.

    Returns
    Type Description
    ParameterExpression

    The parameter expression for the given source type.

    Predicate(IQueryable, ParameterExpression, string, object, FilterType, FilterBehavior, bool, Type)

    Predicate is a Binary expression that needs to be built for a single or a series of values that needs to be passed on to the WHERE expression.

    var binaryExp = queryable.Predicate(parameter,
                "EmployeeID", "4", true);
    Declaration
    public static Expression Predicate(this IQueryable source, ParameterExpression parameterExpression, string propertyName, object constantValue, FilterType filterType, FilterBehavior filterBehavior, bool isCaseSensitive, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    ParameterExpression parameterExpression

    Represents the parameter expression.

    string propertyName

    Represents the property name.

    object constantValue

    Represents the constant value.

    FilterType filterType

    Represents the filter value.

    FilterBehavior filterBehavior

    Represents the filter behavior.

    bool isCaseSensitive

    Determines whether is in case sensitive.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    Expression

    Returns the expression.

    Remarks

    First create a ParameterExpression using the Parameter extension function, then use the same ParameterExpression to generate the predicates.

    Predicate(IQueryable, ParameterExpression, string, object, FilterType, FilterBehavior, bool, Type, Delegate)

    Generates a predicate expression for the given values.

    Declaration
    public static Expression Predicate(this IQueryable source, ParameterExpression parameterExpression, string propertyName, object constantValue, FilterType filterType, FilterBehavior filterBehavior, bool isCaseSensitive, Type sourceType, Delegate expressionFunction)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name.

    object constantValue

    The object.

    FilterType filterType

    The filter type.

    FilterBehavior filterBehavior

    The filter behavior.

    bool isCaseSensitive

    A boolean values indicating whether to consider the expression with case sensitive.

    Type sourceType

    The type of the source

    Delegate expressionFunction

    The expression function.

    Returns
    Type Description
    Expression

    A predicate binary expression for the given values.

    Predicate(IQueryable, ParameterExpression, string, object, FilterType, FilterBehavior, bool, Type, string)

    Generates a predicate expression for the given values.

    Declaration
    public static Expression Predicate(this IQueryable source, ParameterExpression parameterExpression, string propertyName, object constantValue, FilterType filterType, FilterBehavior filterBehavior, bool isCaseSensitive, Type sourceType, string format)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name.

    object constantValue

    The object.

    FilterType filterType

    The filter type.

    FilterBehavior filterBehavior

    The filter behavior.

    bool isCaseSensitive

    A boolean values indicating whether to consider the expression with case sensitive.

    Type sourceType

    The type of the source.

    string format

    Represents the current format.

    Returns
    Type Description
    Expression

    A predicate expression for the given values.

    Predicate(IQueryable, ParameterExpression, string, object, Type, FilterType, FilterBehavior, bool, Type, Delegate)

    Generates a predicate expression for the given values.

    Declaration
    public static Expression Predicate(this IQueryable source, ParameterExpression parameterExpression, string propertyName, object constantValue, Type memberType, FilterType filterType, FilterBehavior filterBehavior, bool isCaseSensitive, Type sourceType, Delegate expressionFunction)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    ParameterExpression parameterExpression

    The parameter expression.

    string propertyName

    The property name.

    object constantValue

    The object.

    Type memberType

    The member type.

    FilterType filterType

    The filter type.

    FilterBehavior filterBehavior

    The filter behavior.

    bool isCaseSensitive

    A boolean values indicating whether to consider the expression with case sensitive.

    Type sourceType

    The type of the source

    Delegate expressionFunction

    The expression function.

    Returns
    Type Description
    Expression

    A predicate binary expression for the given values.

    Select(IQueryable, IEnumerable<string>)

    Generates a Select query based on the given source and the properties passed.

    Declaration
    public static IQueryable Select(this IQueryable source, IEnumerable<string> properties)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    IEnumerable<string> properties

    The enumerable collection of properties.

    Returns
    Type Description
    IQueryable

    A Select query based on the given source and the properties passed.

    Select(IQueryable, IEnumerable<string>, Type)

    Generates a Select query based on the properties passed.

    DataClasses1DataContext db = new
    DataClasses1DataContext();
                var orders = db.Orders.Skip(0).Take(10).ToList();
                var queryable = orders.AsQueryable();
                var selector = queryable.Select(new List<string>() {
    "OrderID", "ShipCountry" });

    It returns a dynamic class generated thru ReflectionEmit, Use reflection to identify the properties and values.

    Declaration
    public static IQueryable Select(this IQueryable source, IEnumerable<string> properties, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    IEnumerable<string> properties

    Represents the properties.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    Select(IQueryable, string)

    Generates a Select query for the given source and property.

    Declaration
    public static IQueryable Select(this IQueryable source, string propertyName)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name for which the query is generated.

    Returns
    Type Description
    IQueryable

    A Select query for the given source and property.

    Select(IQueryable, string, Type)

    Generates a Select query for a single property value.

    Declaration
    public static IQueryable Select(this IQueryable source, string propertyName, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string propertyName

    Represents the property name.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns queryable objects.

    Select(IQueryable, params string[])

    Generates a Select query based on the properties passed.

    DataClasses1DataContext db = new
    DataClasses1DataContext();
                var orders = db.Orders.Skip(0).Take(10).ToList();
                var queryable = orders.AsQueryable();
                var selector = queryable.Select(new string[]{
    "OrderID", "ShipCountry" });
    Declaration
    public static IQueryable Select(this IQueryable source, params string[] properties)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string[] properties

    Represents the properties.

    Returns
    Type Description
    IQueryable

    Returns queryable objects.

    Skip(IQueryable, int)

    Generates a SKIP expression for the given IQueryable source and the constant value.

    Declaration
    public static IQueryable Skip(this IQueryable source, int constValue)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    int constValue

    The constant value.

    Returns
    Type Description
    IQueryable

    A SKIP expression for the given IQueryable source and the constant value.

    Skip(IQueryable, int, Type)

    Generates a SKIP expression in the IQueryable source.

    Declaration
    public static IQueryable Skip(this IQueryable source, int constValue, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The source.

    int constValue

    The constant value.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns queryable objects.

    Sum(IQueryable, string)

    Calculates the result by executing the expression obtained from the queryable sum method based on the given source and property name.

    Declaration
    public static object Sum(this IQueryable source, string propertyName)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Returns
    Type Description
    object

    The result by executing the expression obtained from the queryable sum method based on the given source and property name.

    Sum(IQueryable, string, Expression<Func<string, object, object>>)

    Calculates the result by executing the expression obtained from the queryable sum method based on the given source, property and the expression function.

    Declaration
    public static object Sum(this IQueryable source, string propertyName, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Expression<Func<string, object, object>> expressionFunc

    The expression function.

    Returns
    Type Description
    object

    The result by executing the expression obtained from the queryable sum method based on the given source, property and the expression function.

    Sum(IQueryable, string, Type)

    Calculates the result by executing the expression obtained from the queryable sum method based on the given source type and property name.

    Declaration
    public static object Sum(this IQueryable source, string propertyName, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Type sourceType

    The type of the source.

    Returns
    Type Description
    object

    The result by executing the expression obtained from the queryable sum method based on the given source type and property name.

    Take(IQueryable, int)

    Generates a TAKE expression for the given IQueryable source and the constant value.

    Declaration
    public static IQueryable Take(this IQueryable source, int constValue)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    int constValue

    The constant value.

    Returns
    Type Description
    IQueryable

    A TAKE expression for the given IQueryable source and the constant value.

    Take(IQueryable, int, Type)

    Generates a TAKE expression in the IQueryable source.

    Declaration
    public static IQueryable Take(this IQueryable source, int constValue, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The source.

    int constValue

    The constant value.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    ThenBy(IQueryable, ParameterExpression, Expression)

    Generates a ThenBy query expression for the given source and the expressions.

    Declaration
    public static IQueryable ThenBy(this IQueryable source, ParameterExpression parameterExpression, Expression expression)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    ParameterExpression parameterExpression

    The parameter expression.

    Expression expression

    The expression.

    Returns
    Type Description
    IQueryable

    A ThenBy query expression for the given source and the expressions.

    ThenBy(IQueryable, string)

    Generates a ThenBy query expression for the given queryable source and property name.

    Declaration
    public static IQueryable ThenBy(this IQueryable source, string propertyName)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Returns
    Type Description
    IQueryable

    A ThenBy query expression for the queryable source and property name.

    ThenBy(IQueryable, string, IComparer<object>, Expression<Func<string, object, object>>)

    Generates a ThenBy query expression for the given values.

    Declaration
    public static IQueryable ThenBy(this IQueryable source, string propertyName, IComparer<object> comparer, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    IComparer<object> comparer

    The comparer.

    Expression<Func<string, object, object>> expressionFunc

    The expression function.

    Returns
    Type Description
    IQueryable

    A ThenBy query expression for the given values.

    ThenBy(IQueryable, string, IComparer<object>, Type)

    Generates an ThenBy query expression for the given values.

    Declaration
    public static IQueryable ThenBy(this IQueryable source, string propertyName, IComparer<object> comparer, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    IComparer<object> comparer

    The comparer.

    Type sourceType

    The type of the source.

    Returns
    Type Description
    IQueryable

    An ThenBy query expression for the given values.

    ThenBy(IQueryable, string, Expression<Func<string, object, object>>)

    Generates a ThenBy query expression for the given source, property and the expression function.

    Declaration
    public static IQueryable ThenBy(this IQueryable source, string propertyName, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Expression<Func<string, object, object>> expressionFunc

    The expression function.

    Returns
    Type Description
    IQueryable

    A ThenBy query expression for the given source, property and the expression function.

    ThenBy(IQueryable, string, Type)

    Generates a ThenBy query for the Queryable source.

    DataClasses1DataContext db = new
    DataClasses1DataContext();
                var orders = db.Orders.Skip(0).Take(10).ToList();
                var queryable = orders.AsQueryable();
                var sortedOrders = queryable.OrderBy("ShipCountry");
                sortedOrders = sortedOrders.ThenBy("ShipCity");
    Declaration
    public static IQueryable ThenBy(this IQueryable source, string propertyName, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string propertyName

    Represents the property name.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    ThenByDescending(IQueryable, ParameterExpression, Expression)

    Generates a ThenByDescending query expression for the given source and the expressions.

    Declaration
    public static IQueryable ThenByDescending(this IQueryable source, ParameterExpression parameterExpression, Expression expression)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    ParameterExpression parameterExpression

    The parameter expression.

    Expression expression

    The expression.

    Returns
    Type Description
    IQueryable

    A ThenByDescending query expression for the given source and the expressions.

    ThenByDescending(IQueryable, string)

    Generates a ThenByDescending query for the given source and the property.

    Declaration
    public static IQueryable ThenByDescending(this IQueryable source, string propertyName)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source

    string propertyName

    The property name.

    Returns
    Type Description
    IQueryable

    A ThenByDescending query for the given source and the property.

    ThenByDescending(IQueryable, string, IComparer<object>, Expression<Func<string, object, object>>)

    Generates a ThenByDescending query expression for the given values.

    Declaration
    public static IQueryable ThenByDescending(this IQueryable source, string propertyName, IComparer<object> comparer, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    IComparer<object> comparer

    The comparer.

    Expression<Func<string, object, object>> expressionFunc

    The expression function.

    Returns
    Type Description
    IQueryable

    A ThenByDescending query expression for the given values.

    ThenByDescending(IQueryable, string, IComparer<object>, Type)

    Generates an ThenByDescending query expression for the given values.

    Declaration
    public static IQueryable ThenByDescending(this IQueryable source, string propertyName, IComparer<object> comparer, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    IComparer<object> comparer

    The comparer.

    Type sourceType

    The type of the source.

    Returns
    Type Description
    IQueryable

    An ThenByDescending query expression for the given values.

    ThenByDescending(IQueryable, string, Expression<Func<string, object, object>>)

    Generates a ThenByDescending query expression for the given values.

    Declaration
    public static IQueryable ThenByDescending(this IQueryable source, string propertyName, Expression<Func<string, object, object>> expressionFunc)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The property name.

    Expression<Func<string, object, object>> expressionFunc

    The expression function.

    Returns
    Type Description
    IQueryable

    A ThenByDescending query expression for the given values.

    ThenByDescending(IQueryable, string, Type)

    Generates a ThenByDescending query for the Queryable source.

    DataClasses1DataContext db = new
    DataClasses1DataContext();
                var orders = db.Orders.Skip(0).Take(10).ToList();
                var queryable = orders.AsQueryable();
                var sortedOrders = queryable.OrderBy("ShipCountry");
                sortedOrders = sortedOrders.ThenByDescending("ShipCity");
    Declaration
    public static IQueryable ThenByDescending(this IQueryable source, string propertyName, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string propertyName

    Represents the property name.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    ThenByDescending<T>(IQueryable, IComparer<T>)

    Generates an ThenByDescending query expression for the given source and the comparer for the given type.

    Declaration
    public static IQueryable ThenByDescending<T>(this IQueryable source, IComparer<T> comparer)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    IComparer<T> comparer

    The comparer.

    Returns
    Type Description
    IQueryable

    An ThenByDescending query expression for the given source and the comparer for the given type.

    Type Parameters
    Name Description
    T

    The type parameter.

    ThenByDescending<T>(IQueryable, IComparer<T>, Type)

    Generates an ThenByDescending query for the IComparer defined.

    public class OrdersComparer :
             IComparer<Order>
                 {
                     public int Compare(Order x, Order y)
                     {
                         return string.Compare(x.ShipCountry, y.ShipCountry);
                     }
                 }

    var sortedOrders =
                db.Orders.Skip(0).Take(5).ToList().ThenByDescending(o => o, new
                OrdersComparer());
    Declaration
    public static IQueryable ThenByDescending<T>(this IQueryable source, IComparer<T> comparer, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the source.

    IComparer<T> comparer

    Represents the comparer.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    ThenBy<T>(IQueryable, IComparer<T>)

    Generates an ThenBy query expression for the given source and the comparer for the given type.

    Declaration
    public static IQueryable ThenBy<T>(this IQueryable source, IComparer<T> comparer)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    IComparer<T> comparer

    The comparer.

    Returns
    Type Description
    IQueryable

    An ThenBy query expression for the given source and the comparer for the given type.

    Type Parameters
    Name Description
    T

    The type parameter.

    ThenBy<T>(IQueryable, IComparer<T>, Type)

    Generates an ThenBy query for the IComparer defined.

    public class OrdersComparer :
             IComparer<Order>
                 {
                     public int Compare(Order x, Order y)
                     {
                         return string.Compare(x.ShipCountry, y.ShipCountry);
                     }
                 }

    var sortedOrders =
                db.Orders.Skip(0).Take(5).ToList().ThenBy(o => o, new
                OrdersComparer());
    Declaration
    public static IQueryable ThenBy<T>(this IQueryable source, IComparer<T> comparer, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    IComparer<T> comparer

    Represents the comparer.

    Type sourceType

    Represents the source type.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    Where(IQueryable, ParameterExpression, Expression)

    Use this function to generate WHERE expression based on Predicates. The AndPredicate and OrPredicate should be used in combination to build the predicate expression which is finally passed on to this function for creating a Lambda.

    DataClasses1DataContext database = new DataClasses1DataContext();

    var orders = database.Orders.Skip(0).Take(100).ToList();

    var queryable = orders.AsQueryable();

    var parameter = queryable.Parameter("ShipCountry");

    var binaryExpression = queryable.Predicate(parameter,

    "ShipCountry", "USA", true);

    var filteredOrders = queryable.Where(parameter, binaryExpression);

    foreach (var order in filteredOrders)

    {

    Console.WriteLine(order);
    

    }

    Build Predicates for Contains / StartsWith / EndsWith,

    IQueryable queryable = model.Orders.AsQueryable();

    var parameter = queryable.Parameter();

    var expression1 = queryable.Predicate(parameter, "ShipCountry", "h", FilterType.Contains);

    var expression2 = queryable.Predicate(parameter, "ShipCountry", "a", FilterType.StartsWith);

    var andExpression = expression2.OrPredicate(expression1);

    var filters = queryable.Where(parameter, andExpression);

    foreach (Orders item in filters)

    {

    Console.WriteLine("{0}/{1}",
    

    item.OrderID, item.ShipCountry);

    }

    Declaration
    public static IQueryable Where(this IQueryable source, ParameterExpression parameterExpression, Expression predicateExpression)
    Parameters
    Type Name Description
    IQueryable source

    Represents the source.

    ParameterExpression parameterExpression

    Represents the parameter expression.

    Expression predicateExpression

    Represents the predicate expression.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    Where(IQueryable, string, object, FilterType, bool)

    Generates the where expression for the given values.

    Declaration
    public static IQueryable Where(this IQueryable source, string propertyName, object value, FilterType filterType, bool isCaseSensitive)
    Parameters
    Type Name Description
    IQueryable source

    The IQueryable source.

    string propertyName

    The name of the property.

    object value

    The object.

    FilterType filterType

    The filter type.

    bool isCaseSensitive

    A boolean value indicating whether the expression should be considered as case sensitive or not.

    Returns
    Type Description
    IQueryable

    The where expression for the given values.

    Where(IQueryable, string, object, FilterType, bool, Type)

    Generates the where expression.

    var nw = new Northwind(@"Data Source =
    Northwind.sdf");
                IQueryable queryable = nw.Orders.AsQueryable();
                var filters = queryable.Where("ShipCountry",
    "z", FilterType.Contains);
                foreach (Orders item in filters)
                {
                    Console.WriteLine("{0}/{1}", item.OrderID,
    item.ShipCountry);
                }
    Declaration
    public static IQueryable Where(this IQueryable source, string propertyName, object value, FilterType filterType, bool isCaseSensitive, Type sourceType)
    Parameters
    Type Name Description
    IQueryable source

    Represents the queryable source.

    string propertyName

    Name of the property.

    object value

    Represents the value.

    FilterType filterType

    Represents the filter value.

    bool isCaseSensitive

    Determines whether is in case sensitive.

    Type sourceType

    Represents the type of source.

    Returns
    Type Description
    IQueryable

    Returns the queryable objects.

    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved