Class SkipTakeIteratorBase<T>
Base implementation for Query iterators.
Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsQuerying
Assembly: Stylelabs.M.Sdk.dll
Syntax
public abstract class SkipTakeIteratorBase<T> : IQueryIterator<T>, IIterator where T : class, IQueryResultType Parameters
| Name | Description |
|---|---|
| T |
The type result returned by the iterator. |
Constructors
SkipTakeIteratorBase(T)
Initializes a new instance of the SkipTakeIteratorBase<T> class and continues iterating from the specified result on.
Declaration
protected SkipTakeIteratorBase(T result)Parameters
| Type | Name | Description |
|---|---|---|
| T | result |
The result to start iterating from. |
SkipTakeIteratorBase(long)
Initializes a new instance of the SkipTakeIteratorBase<T> class.
Declaration
protected SkipTakeIteratorBase(long pageSize)Parameters
| Type | Name | Description |
|---|---|---|
| long | pageSize |
The size of the page. |
Properties
Current
Gets get the current result during iteration.
Declaration
public T Current { get; }Property Value
| Type | Description |
|---|---|
| T |
Methods
CanMoveNext()
Checks if the iterator can move further through the results.
Declaration
public bool CanMoveNext()Returns
| Type | Description |
|---|---|
| bool |
true if there more results. |
CanMovePrevious()
Checks if the iterator can move backwards through the results.
Declaration
public bool CanMovePrevious()Returns
| Type | Description |
|---|---|
| bool |
true if there move backwards. |
GetResultAsync(long, long)
Gets results.
Declaration
protected abstract Task<T> GetResultAsync(long skip, long take)Parameters
| Type | Name | Description |
|---|---|---|
| long | skip |
How many items to skip. |
| long | take |
How many items to take. |
Returns
| Type | Description |
|---|---|
| Task<> |
The results. |
MoveNextAsync()
Advances the enumerator to the next page/batch of the collection. The result will be available in Current.
Declaration
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.
Declaration
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
public void Reset()Explicit Interface Implementations
IIterator.Current
Gets the current result. This is initially null. Use MoveNextAsync() first.
Declaration
object IIterator.Current { get; }Returns
| Type | Description |
|---|---|
| object |