> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# IQueryExpressionSourcer

> Represents a service that replace queryable source of an expression.

## Definition

**Assembly:** Microsoft.Restier.Core.dll

**Namespace:** Microsoft.Restier.Core.Query

## Syntax

```csharp theme={"dark"}
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

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ReplaceQueryableSource <Badge color="orange">Abstract</Badge>

Replace queryable source of an expression.

#### Syntax

```csharp theme={"dark"}
System.Linq.Expressions.Expression ReplaceQueryableSource(Microsoft.Restier.Core.Query.QueryExpressionContext context, bool embedded)
```

#### Parameters

| Name       | Type                                                  | Description                                                 |
| ---------- | ----------------------------------------------------- | ----------------------------------------------------------- |
| `context`  | `Microsoft.Restier.Core.Query.QueryExpressionContext` | The query expression context.                               |
| `embedded` | `bool`                                                | Indicates 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.
