ParameterExpression Class

Updated: October 2008

Represents a named parameter expression.

Namespace:  System.Linq.Expressions
Assembly:  System.Core (in System.Core.dll)

public sealed class ParameterExpression : Expression

Use the Parameter factory method to create a ParameterExpression.

The value of the NodeType property of a ParameterExpression object is Parameter.

For example, assume that you have the following query:

companies.Where(company => (company.ToLower() == "coho winery" || 
    company.Length > 16)).OrderBy(company => company)

In this case, company becomes a parameter expression. To construct an expression tree for this parameter, you can use the following code:

ParameterExpression pe = Expression.Parameter(typeof(string), "company");

You can find a complete example of using parameter expressions in expression trees in How to: Use Expression Trees to Build Dynamic Queries.

System.Object
  System.Linq.Expressions.Expression
    System.Linq.Expressions.ParameterExpression

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Date

History

Reason

October 2008

Added example.

Customer feedback.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft