protected override async Task <bool> GetDataAsync() { var resource = new CustomerAccountResource(Context); _results = await resource.GetAccountsAsync(startIndex : StartIndex, pageSize : PageSize, sortBy : SortBy, filter : Filter, q : Q, qLimit : QLimit, responseFields : ResponseFields); TotalCount = _results.TotalCount; PageCount = _results.PageCount; PageSize = _results.PageSize; return(_results.Items != null && _results.Items.Count > 0); }
private List <CustomerAccount> GetAllAccounts() { var accounts = new List <CustomerAccount>(); var startIndex = 0; CustomerAccountCollection accountCollection = CustomerAccountFactory.GetAccounts(ApiMsgHandler, startIndex, pageSize: 200); accounts.AddRange(accountCollection.Items); while (accounts.Count < accountCollection.TotalCount) { startIndex += 200; accountCollection = CustomerAccountFactory.GetAccounts(ApiMsgHandler, startIndex, pageSize: 200); accounts.AddRange(accountCollection.Items); } return(accounts); }
public void CustomerDeleteAllAccounts_success() { //DeleteAccount var startIndex = 0; var contactCount = 0; while (true) { CustomerAccountCollection accountCollection = CustomerAccountFactory.GetAccounts(ApiMsgHandler, startIndex, pageSize: 200); if (accountCollection.Items.Count == 0) { break; } foreach (var customerAccount in accountCollection.Items) { CustomerAccountFactory.DeleteAccount(ApiMsgHandler, customerAccount.Id, expectedCode: HttpStatusCode.NoContent); } } }