public async Task <IEnumerable <T> > GetAll <T>(string path, PagingPropertyNames propertyNames, int pageSize = 50) { var result = new List <T>(); var offset = 0; IDictionary <string, object> page; do { page = await Get <IDictionary <string, object> >(JoinPathWithQueryString(path, new Dictionary <string, string> { { propertyNames.OffsetName, offset.ToString() }, { propertyNames.PageSizeName, pageSize.ToString() }, })).ConfigureAwait(false); var items = ConvertToEnumerable <T>(page.GetCaseInensitive(propertyNames.ItemsName)); result.AddRange(items); offset += pageSize; } while (offset < Convert.ToInt32(page.GetCaseInensitive(propertyNames.TotalName))); return(result); }
public async Task <IEnumerable <dynamic> > GetAll(string path, PagingPropertyNames propertyNames, int pageSize = 50) { return(await GetAll <ExpandoObject>(path, propertyNames, pageSize).ConfigureAwait(false)); }