Pageable<T>
A collection of values that may take multiple service requests to
iterate over.
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Threading;
namespace Azure
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
public abstract class Pageable<T> : IEnumerable<T>, IEnumerable
{
[System.Runtime.CompilerServices.Nullable(new byte[] {
0,
1
})]
private class StaticPageable : Pageable<T>
{
private readonly IEnumerable<Page<T>> _pages;
public StaticPageable(IEnumerable<Page<T>> pages)
{
_pages = pages;
}
[IteratorStateMachine(typeof(Pageable<>.StaticPageable.<AsPages>d__2))]
public override IEnumerable<Page<T>> AsPages([System.Runtime.CompilerServices.Nullable(2)] string continuationToken = null, int? pageSizeHint = default(int?))
{
<AsPages>d__2 <AsPages>d__ = new <AsPages>d__2(-2);
<AsPages>d__.<>4__this = this;
<AsPages>d__.<>3__continuationToken = continuationToken;
return <AsPages>d__;
}
}
protected virtual CancellationToken CancellationToken { get; }
protected Pageable()
{
CancellationToken = CancellationToken.None;
}
protected Pageable(CancellationToken cancellationToken)
{
CancellationToken = cancellationToken;
}
public abstract IEnumerable<Page<T>> AsPages([System.Runtime.CompilerServices.Nullable(2)] string continuationToken = null, int? pageSizeHint = default(int?));
[System.Runtime.CompilerServices.NullableContext(2)]
[EditorBrowsable(EditorBrowsableState.Never)]
public override string ToString()
{
return base.ToString();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
[IteratorStateMachine(typeof(Pageable<>.<GetEnumerator>d__8))]
public virtual IEnumerator<T> GetEnumerator()
{
<GetEnumerator>d__8 <GetEnumerator>d__ = new <GetEnumerator>d__8(0);
<GetEnumerator>d__.<>4__this = this;
return <GetEnumerator>d__;
}
public static Pageable<T> FromPages(IEnumerable<Page<T>> pages)
{
return new StaticPageable(pages);
}
[System.Runtime.CompilerServices.NullableContext(2)]
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj)
{
return base.Equals(obj);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode()
{
return base.GetHashCode();
}
}
}