---
title: "Interface IIterator"
slug: "sdk--stylelabs.m.sdk.contracts.base.iiterator"
abstract: ""
---
# Interface IIterator

Base interface for iterators.

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

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public interface IIterator
```

## Properties

### 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 Current { get; }
```

#### Property Value

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

## Methods

### CanMoveNext()

Checks if the iterator can move further through the results.

#### Declaration

```csharp
bool CanMoveNext()
```

#### Returns

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

### CanMovePrevious()

Checks if the iterator can move backwards through the results.

#### Declaration

```csharp
bool CanMovePrevious()
```

#### Returns

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

### 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
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
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
void Reset()
```
