---
title: "Class WhereExpressionTreeVisitor"
slug: "sdk--stylelabs.m.base.querying.linq.whereexpressiontreevisitor"
abstract: ""
---
# Class WhereExpressionTreeVisitor

Converts a , taken from the where-clause of a linq query, into a [QueryFilter](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.base.querying.filters.queryfilter.html).

## Inheritance

object

WhereExpressionTreeVisitor

## Namespace: StylelabsStylelabs.MStylelabs.M.BaseQueryingLinq

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public class WhereExpressionTreeVisitor : ThrowingExpressionVisitor
```

## Methods

### CreateFilter(Expression)

Converts the specified `expression` into a [QueryFilter](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.base.querying.filters.queryfilter.html).

#### Declaration

```csharp
public static QueryFilter CreateFilter(Expression expression)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| Expression | expression | The expression to convert. |

#### Returns

| Type | Description |
| --- | --- |
| [QueryFilter](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.base.querying.filters.queryfilter.html) | A [QueryFilter](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.base.querying.filters.queryfilter.html) containing the converted `expression`. |

### CreateUnhandledItemException<T>(T, string)

#### Declaration

```csharp
protected override Exception CreateUnhandledItemException<T>(T unhandledItem, string visitMethod)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| T | unhandledItem |  |
| string | visitMethod |  |

#### Returns

| Type | Description |
| --- | --- |
| Exception |  |

#### Type Parameters

| Name | Description |
| --- | --- |
| T |  |

### VisitBinary(BinaryExpression)

#### Declaration

```csharp
protected override Expression VisitBinary(BinaryExpression expression)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| BinaryExpression | expression |  |

#### Returns

| Type | Description |
| --- | --- |
| Expression |  |

### VisitMethodCall(MethodCallExpression)

#### Declaration

```csharp
protected override Expression VisitMethodCall(MethodCallExpression expression)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| MethodCallExpression | expression |  |

#### Returns

| Type | Description |
| --- | --- |
| Expression |  |

### VisitUnary(UnaryExpression)

#### Declaration

```csharp
protected override Expression VisitUnary(UnaryExpression expression)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| UnaryExpression | expression |  |

#### Returns

| Type | Description |
| --- | --- |
| Expression |  |
