Skip to main content

Definition

Assembly: Microsoft.Restier.Core.dll Namespace: Microsoft.Restier.Core.Query

Syntax

Microsoft.Restier.Core.Query.IQueryExpressionSourcer

Summary

Represents a service that replace queryable source of an expression.

Remarks

Query expression sourcing converts an expression that identifies API data in a normalized manner to an equivalent representation in terms of the underlying data source proxy. Sourcing is the last step that occurs when processing a query expression, and only happens on expressions that represent API data that cannot be expanded into any more primitive of an expression.

Methods

ReplaceQueryableSource Abstract

Replace queryable source of an expression.

Syntax

System.Linq.Expressions.Expression ReplaceQueryableSource(Microsoft.Restier.Core.Query.QueryExpressionContext context, bool embedded)

Parameters

NameTypeDescription
contextMicrosoft.Restier.Core.Query.QueryExpressionContextThe query expression context.
embeddedboolIndicates if the sourcing is occurring on an embedded node.

Returns

Type: System.Linq.Expressions.Expression A data source expression that represents the visited node.

Remarks

When embedded is false, this method should produce a constant expression whose value is a queryable object produced by calling into the underlying data source proxy. When embedded is true, this method should return an expression that represents the API data identified by the visited node in terms of the underlying data source proxy. Consider an example where the data source API has a method to get a query over customers, accessed through “data.GetCustomers()”. When embedded is false, this method should call that method and return a constant expression containing the query. When embedded is true, this method should build a call expression to “GetCustomers” where the object to which it applies is a constant expression whose value is the data object.