//Virtural List Implementation public async Task <Tuple <IEnumerable <PackageType>, int> > LoadRange(int startIndex, int count, string exp, Dictionary <string, string> navExp, IEnumerable <string> includeLst = null) { var overallCount = 0; if (System.ComponentModel.LicenseManager.UsageMode == LicenseUsageMode.Designtime || exp == null || exp == "None") { return(new Tuple <IEnumerable <PackageType>, int>(new List <PackageType>().AsEnumerable(), overallCount)); } try { using (var t = new PackageTypeClient()) { IEnumerable <DTO.PackageType> res = null; res = await t.LoadRangeNav(startIndex, count, exp, navExp, includeLst).ConfigureAwait(continueOnCapturedContext: false); overallCount = await t.CountNav(exp, navExp).ConfigureAwait(continueOnCapturedContext: false); if (res != null) { return(new Tuple <IEnumerable <PackageType>, int>(res.Select(x => new PackageType(x)).AsEnumerable(), overallCount)); } else { return(null); } } } catch (FaultException <ValidationFault> e) { throw new Exception(e.Detail.Message, e.InnerException); } catch (Exception) { Debugger.Break(); throw; } }