Table of Contents

Class SelectExpandQueryOption

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

Represents the OData $select and $expand query options.

public class SelectExpandQueryOption
Inheritance
SelectExpandQueryOption
Inherited Members

Constructors

SelectExpandQueryOption(string, string, ODataQueryContext)

Initializes a new instance of the SelectExpandQueryOption class.

public SelectExpandQueryOption(string select, string expand, ODataQueryContext context)

Parameters

select string

The $select query parameter value.

expand string

The $select query parameter value.

context ODataQueryContext

The ODataQueryContext which contains the Microsoft.Data.Edm.IEdmModel and some type information.

Properties

Context

Gets the given ODataQueryContext.

public ODataQueryContext Context { get; }

Property Value

ODataQueryContext

RawExpand

Gets the raw $expand value.

public string RawExpand { get; }

Property Value

string

RawSelect

Gets the raw $select value.

public string RawSelect { get; }

Property Value

string

SelectExpandClause

Gets the parsed SelectExpandClause for this query option.

public SelectExpandClause SelectExpandClause { get; }

Property Value

SelectExpandClause

Validator

Gets or sets the $select and $expand query validator.

public SelectExpandQueryValidator Validator { get; set; }

Property Value

SelectExpandQueryValidator

Methods

ApplyTo(IQueryable, ODataQuerySettings)

Applies the $select and $expand query options to the given IQueryable using the given ODataQuerySettings.

public IQueryable ApplyTo(IQueryable queryable, ODataQuerySettings settings)

Parameters

queryable IQueryable

The original IQueryable.

settings ODataQuerySettings

The ODataQuerySettings that contains all the query application related settings.

Returns

IQueryable

The new IQueryable after the filter query has been applied to.

ApplyTo(object, ODataQuerySettings)

Applies the $select and $expand query options to the given entity using the given ODataQuerySettings.

public object ApplyTo(object entity, ODataQuerySettings settings)

Parameters

entity object

The original entity.

settings ODataQuerySettings

The ODataQuerySettings that contains all the query application related settings.

Returns

object

The new entity after the $select and $expand query has been applied to.

Validate(ODataValidationSettings)

Validate the $select and $expand query based on the given validationSettings. It throws an ODataException if validation failed.

public void Validate(ODataValidationSettings validationSettings)

Parameters

validationSettings ODataValidationSettings

The ODataValidationSettings instance which contains all the validation settings.