---
title: "Class LoadingQueryIteratorBase<T>"
slug: "sdk--stylelabs.m.sdk.models.querying.loadingqueryiteratorbase-1"
abstract: ""
---
# Class LoadingQueryIteratorBase<T>

Base implementation for Query iterators that support loading of entities.

## Inheritance

object

LoadingQueryIteratorBase<T>

[EntityIterator](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.querying.entityiterator.html)

## Implements

[IQueryIterator](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.querying.generic.iqueryiterator-1.html)

[IIterator](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.iiterator.html)

## Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsQuerying

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public abstract class LoadingQueryIteratorBase<T> : IQueryIterator<T>, IIterator where T : class, IQueryResult
```

## Type Parameters

| Name | Description |
| --- | --- |
| T | The type result returned by the iterator. |

## Constructors

### LoadingQueryIteratorBase(Query, IEntityLoadConfiguration, T)

Initializes a new instance of the [LoadingQueryIteratorBase<T>](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.querying.loadingqueryiteratorbase-1.html) class.

#### Declaration

```csharp
protected LoadingQueryIteratorBase(Query query, IEntityLoadConfiguration loadConfiguration, T result)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [Query](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.base.querying.query.html) | query | The 'request' query. |
| [IEntityLoadConfiguration](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadconfigurations.ientityloadconfiguration.html) | loadConfiguration | The load configuration. |
| T | result | The current result. |

### LoadingQueryIteratorBase(Query, IEntityLoadConfiguration)

Initializes a new instance of the [LoadingQueryIteratorBase<T>](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.models.querying.loadingqueryiteratorbase-1.html) class. Optionally, you can pass a result, and the iterator will continue from that point on.

#### Declaration

```csharp
protected LoadingQueryIteratorBase(Query query, IEntityLoadConfiguration loadConfiguration)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [Query](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.base.querying.query.html) | query | The 'request' query. |
| [IEntityLoadConfiguration](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadconfigurations.ientityloadconfiguration.html) | loadConfiguration | The load configuration. |

## Properties

### Current

Gets get the current result during iteration.

#### Declaration

```csharp
public T Current { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| T |  |

## Methods

### CanMoveNext()

Checks if the iterator can move further through the results.

#### Declaration

```csharp
public bool CanMoveNext()
```

#### Returns

| Type | Description |
| --- | --- |
| bool | true if there more results. |

### CanMovePrevious()

Checks if the iterator can move backwards through the results.

#### Declaration

```csharp
public bool CanMovePrevious()
```

#### Returns

| Type | Description |
| --- | --- |
| bool | true if there move backwards. |

### GetResultAsync(Query, IEntityLoadConfiguration)

Gets the results.

#### Declaration

```csharp
protected abstract Task<T> GetResultAsync(Query query, IEntityLoadConfiguration loadConfiguration)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [Query](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.base.querying.query.html) | query | The 'request' query. |
| [IEntityLoadConfiguration](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.framework.essentials.loadconfigurations.ientityloadconfiguration.html) | loadConfiguration | The load configuration. |

#### Returns

| Type | Description |
| --- | --- |
| Task<> | The query results. |

### MoveNextAsync()

Advances the enumerator to the next page/batch of the collection. The result will be available in [Current](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.iiterator.html).

#### Declaration

```csharp
public Task<bool> MoveNextAsync()
```

#### Returns

| Type | Description |
| --- | --- |
| Task<>bool | true if the enumerator was successfully advanced to the next page; false if the enumerator has passed the end of the collection. |

### MovePreviousAsync()

Moves the enumerator backwards, to the previous page/batch of the collection. The result will be available in [Current](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.iiterator.html).

#### Declaration

```csharp
public Task<bool> MovePreviousAsync()
```

#### Returns

| Type | Description |
| --- | --- |
| Task<>bool | true if the enumerator was successfully advanced to the previous page; false if the enumerator has passed the start of the collection. |

### Reset()

Resets the iterator to start before the first result again.

#### Declaration

```csharp
public void Reset()
```

### Explicit Interface Implementations

### IIterator.Current

Gets the current result. This is initially null. Use [MoveNextAsync()](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.iiterator.html) first.

#### Declaration

```csharp
object IIterator.Current { get; }
```

#### Returns

| Type | Description |
| --- | --- |
| object |  |

### Implements

[IQueryIterator<T>](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.querying.generic.iqueryiterator-1.html)

[IIterator](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.base.iiterator.html)
