public IEnumerator GetEnumerator() { string href = GetURI(); ResourcePage <T> page = new ResourcePage <T>(href); iterator = new ResourceIterator(href, page); return(iterator); }
public List <T> All() { string href = GetURI(); ResourcePage <T> page = new ResourcePage <T>(href); List <T> items = new List <T>(page.GetTotal()); ResourceIterator iterator = new ResourceIterator(href, page); while (iterator.MoveNext()) { object obj = iterator.Current; items.Add((T)obj); } return(items); }
/// <summary> /// The get enumerator. /// </summary> /// <returns>The <see cref="IEnumerator" />.</returns> public IEnumerator <T> GetEnumerator() { var current = new ResourcePage <T>(this.uri); while (current != null) { foreach (var i in current.items) { yield return(i); } current = current.Next; } }
public ResourceIterator(String pHref, ResourcePage <T> pPage) { href = pHref; page = pPage; index = 0; }