QueryableAttribute Class

This class defines an attribute that can be applied to an action to enable querying using the OData query syntax. To avoid processing unexpected or malicious queries, use the validation settings on QueryableAttribute to validate incoming queries. For more information, visit http://go.microsoft.com/fwlink/?LinkId=279712.

Inheritance Hierarchy

System.Object
  System.Attribute
    System.Web.Http.Filters.FilterAttribute
      System.Web.Http.Filters.ActionFilterAttribute
        System.Web.Http.QueryableAttribute

Namespace:  System.Web.Http
Assembly:  System.Web.Http.OData (in System.Web.Http.OData.dll)

Syntax

'Declaration
<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Method, Inherited := True,  _
    AllowMultiple := False)> _
Public Class QueryableAttribute _
    Inherits ActionFilterAttribute
'Usage
Dim instance As QueryableAttribute
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method, Inherited = true, 
    AllowMultiple = false)]
public class QueryableAttribute : ActionFilterAttribute
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Method, Inherited = true, 
    AllowMultiple = false)]
public ref class QueryableAttribute : public ActionFilterAttribute
[<AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method, Inherited = true, 
    AllowMultiple = false)>]
type QueryableAttribute =  
    class 
        inherit ActionFilterAttribute 
    end
public class QueryableAttribute extends ActionFilterAttribute

The QueryableAttribute type exposes the following members.

Constructors

  Name Description
Public method QueryableAttribute Initializes a new instance of the QueryableAttribute class.

Top

Properties

  Name Description
Public property AllowedArithmeticOperators Gets or sets a value that represents a list of allowed arithmetic operators including 'add', 'sub', 'mul', 'div', 'mod'.
Public property AllowedFunctions Gets or sets a value that represents a list of allowed functions used in the $filter query.
Public property AllowedLogicalOperators Gets or sets a value that represents a list of allowed logical Operators such as 'eq', 'ne', 'gt', 'ge', 'lt', 'le', 'and', 'or', 'not'.
Public property AllowedOrderByProperties Gets or sets a string with comma-separated list of property names. The queryable result can only be ordered by those properties defined in this list.
Public property AllowedQueryOptions Gets or sets the query parameters that are allowed in queries.
Public property AllowMultiple (Inherited from FilterAttribute.)
Public property EnableConstantParameterization Gets or sets a value indicating whether constants should be parameterized. Parameterizing constants would result in better performance with Entity framework.
Public property EnsureStableOrdering Gets or sets a value indicating whether query composition should alter the original query when necessary to ensure a stable sort order.
Public property HandleNullPropagation Gets or sets a value indicating how null propagation should be handled during query composition.
Public property MaxAnyAllExpressionDepth Gets or sets the maximum depth of the Any or All elements nested inside the query.
Public property MaxExpansionDepth Gets or sets the max expansion depth for the $expand query option.
Public property MaxNodeCount Gets or sets the maximum number of nodes inside the $filter syntax tree.
Public property MaxOrderByNodeCount Gets or sets the maximum number of expressions that can be present in the $orderby.
Public property MaxSkip Gets or sets the max value of $skip that a client can request.
Public property MaxTop Gets or sets the max value of $top that a client can request.
Public property PageSize Gets or sets the maximum number of query results to send back to clients.
Public property TypeId (Inherited from Attribute.)

Top

Methods

  Name Description
Public method ApplyQuery(IQueryable, ODataQueryOptions) Applies the query to the given entity based on incoming query from uri and query settings.
Public method ApplyQuery(Object, ODataQueryOptions) Applies the query to the given entity based on incoming query from uri and query settings.
Public method Equals (Inherited from Attribute.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Attribute.)
Public method GetModel Gets the EDM model for the given type and request.
Public method GetType (Inherited from Object.)
Public method IsDefaultAttribute (Inherited from Attribute.)
Public method Match (Inherited from Attribute.)
Protected method MemberwiseClone (Inherited from Object.)
Public method OnActionExecuted Performs the query composition after action is executed. (Overrides ActionFilterAttribute.OnActionExecuted(HttpActionExecutedContext).)
Public method OnActionExecutedAsync (Inherited from ActionFilterAttribute.)
Public method OnActionExecuting (Inherited from ActionFilterAttribute.)
Public method OnActionExecutingAsync (Inherited from ActionFilterAttribute.)
Public method ToString (Inherited from Object.)
Public method ValidateQuery Validates the OData query in the incoming request.

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IActionFilter.ExecuteActionFilterAsync (Inherited from ActionFilterAttribute.)
Explicit interface implemetationPrivate method _Attribute.GetIDsOfNames (Inherited from Attribute.)
Explicit interface implemetationPrivate method _Attribute.GetTypeInfo (Inherited from Attribute.)
Explicit interface implemetationPrivate method _Attribute.GetTypeInfoCount (Inherited from Attribute.)
Explicit interface implemetationPrivate method _Attribute.Invoke (Inherited from Attribute.)

Top

Remarks

No content here will be updated; please do not add material here.

Thread Safety

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

See Also

Reference

System.Web.Http Namespace