InternettinHoca adlı üyeden alıntı: mesajı görüntüle
categoryService, getCategories, categories gibi propertyler'in null gelmediğinden emin olman lazım. değerlerden birisi null geliyor metod katarında
Aşağıdaki kodlar çok yavaş çalışıyor ve her defasında 100 en fazla veri çekmiyor. toplam 5027 kategori var.

try
{
CategoryList1.Items.Clear();
GittiGidiyor.ConfigurationManager.setAuthParameters(config);
GittiGidiyor.Category.CategoryService categoryService = ServiceProvider.getCategoryService();
GittiGidiyor.Category.categoryServiceResponse CategoryResponse = categoryService.getCategories(0, 100, true, true, true, "tr");
GittiGidiyor.Category.categoryType[] category = CategoryResponse.categories;

var rowCount = CategoryResponse.categoryCount;

foreach (GittiGidiyor.Category.categoryType categories in category)
{
Item obj = new Item();
obj.strText = categories.categoryName.ToString();
obj.strValue = categories.categoryCode.ToString();
this.CategoryList1.Items.Add(obj);

}

}
catch (Exception Ex)
{
label1.Text = Environment.NewLine + Ex.ToString();
// MessageBox.Show(Environment.NewLine + Ex.ToString());
}





Aşağıdaki gibi bir çözüm buldum tüm verileri çekmek adına fakat burası da hata veriyor. hatamın çözümünü bulamadım
try
{
CategoryList1.Items.Clear();
GittiGidiyor.ConfigurationManager.setAuthParameters(config);
GittiGidiyor.Category.CategoryService categoryService = ServiceProvider.getCategoryService();
GittiGidiyor.Category.categoryServiceResponse CategoryResponse = categoryService.getCategories(0, 100, true, true, true, "tr");
GittiGidiyor.Category.categoryType[] category = CategoryResponse.categories;

var rowCount = CategoryResponse.categoryCount;

int n = 1;
for (var i = 0; i < 2; i -= -100)
{
Task.Run(() =>
{
CategoryList1.Items.AddRange(
categoryService.getCategories(i, 100, true, true, true, "tr")
.categories
.Select(selector: p => $"{p.categoryName}").Cast<object>().ToArray());
});
}

}
catch (Exception Ex)
{
label1.Text = Environment.NewLine + Ex.ToString();
// MessageBox.Show(Environment.NewLine + Ex.ToString());
}