public async Task <IEnumerable <Entity> > GetAsync( int fromResultIndex, int toResultIndex, List <KeyValuePair <EntityFilterColumn, string> > filterColumn, EntitySortColumn sortColumn, Order order ) { var url = BuildGetListRequestUrl(filterColumn, sortColumn, order); var rawJsonData = await HttpHelper.GetRawJsonDataAsync(url, fromResultIndex, toResultIndex); return(BuildGetListResponseObjects(rawJsonData)); }
private string BuildGetListRequestUrl( List <KeyValuePair <EntityFilterColumn, string> > filterColumn, EntitySortColumn sortColumn, Order order ) { var url = string.Format("{0}?{1}sort({2}{3})", BaseUrl, filterColumn == null ? "" : string.Join("&", filterColumn.Select(_ => _.Key + "=" + _.Value)) + "&", order == Order.Asc ? "+" : "-", sortColumn.ToString() ); return (url); }