Table of Contents

Class ODataValidationSettings

Namespace
System.Web.Http.OData.Query
Assembly
System.Web.Http.OData.dll

This class describes the validation settings for querying.

public class ODataValidationSettings
Inheritance
ODataValidationSettings
Inherited Members

Constructors

ODataValidationSettings()

public ODataValidationSettings()

Properties

AllowedArithmeticOperators

Gets or sets a list of allowed arithmetic operators including 'add', 'sub', 'mul', 'div', 'mod'.

public AllowedArithmeticOperators AllowedArithmeticOperators { get; set; }

Property Value

AllowedArithmeticOperators

AllowedFunctions

Gets or sets a list of allowed functions used in the $filter query. The allowed functions include the following: String related: substringof, endswith, startswith, length, indexof, substring, tolower, toupper, trim, concat e.g. ~/Customers?$filter=length(CompanyName) eq 19 DateTime related: year, years, month, months, day, days, hour, hours, minute, minutes, second, seconds e.g. ~/Employees?$filter=year(BirthDate) eq 1971 Math related: round, floor, ceiling Type related:isof, cast, Collection related: any, all

public AllowedFunctions AllowedFunctions { get; set; }

Property Value

AllowedFunctions

AllowedLogicalOperators

Gets or sets a list of allowed logical operators such as 'eq', 'ne', 'gt', 'ge', 'lt', 'le', 'and', 'or', 'not'.

public AllowedLogicalOperators AllowedLogicalOperators { get; set; }

Property Value

AllowedLogicalOperators

AllowedOrderByProperties

Gets a list of properties one can orderby the result with. Note, by default this list is empty, it means it can be ordered by any property. For example, having an empty collection means client can order the queryable result by any properties. Adding "Name" to this list means that it only allows queryable result to be ordered by Name property.

public Collection<string> AllowedOrderByProperties { get; }

Property Value

Collection<string>

AllowedQueryOptions

Gets or sets the query parameters that are allowed inside query. The default is all query options, including $filter, $skip, $top, $orderby, $expand, $select, $inlineCount, $format and $skiptoken.

public AllowedQueryOptions AllowedQueryOptions { get; set; }

Property Value

AllowedQueryOptions

MaxAnyAllExpressionDepth

Gets or sets the maximum depth of the Any or All elements nested inside the query.

public int MaxAnyAllExpressionDepth { get; set; }

Property Value

int

The maximum depth of the Any or All elements nested inside the query.

MaxExpansionDepth

Gets or sets the max expansion depth for the $expand query option.

public int MaxExpansionDepth { get; set; }

Property Value

int

MaxNodeCount

Gets or sets the maximum number of the nodes inside the $filter syntax tree.

public int MaxNodeCount { get; set; }

Property Value

int

MaxOrderByNodeCount

Gets or sets the maximum number of expressions that can be present in the $orderby.

public int MaxOrderByNodeCount { get; set; }

Property Value

int

MaxSkip

Gets or sets the max value of $skip that a client can request.

public int? MaxSkip { get; set; }

Property Value

int?

MaxTop

Gets or sets the max value of $top that a client can request.

public int? MaxTop { get; set; }

Property Value

int?