Bukimedia / PrestaSharp

CSharp .Net client library for the PrestaShop API via web service
GNU General Public License v3.0
155 stars 152 forks source link

Check category exist #307

Closed MarcoTroise closed 5 years ago

MarcoTroise commented 6 years ago

Hi all, how can i check if category exist?

polaije commented 6 years ago

Hi, I am now writing an application using web service with external provider and this is my solution: CategoryFactory categoriesFact = new CategoryFactory(baseurl, account, ""); Dictionary<string, string> filter = new Dictionary<string, string>(); filter.Add("id", YouSearchId); filter.Add("active", "1"); List categories = categoriesFact.GetByFilter(filter, null, null); if(categories.Count>0) {console.write "Exist...";}

Good luck, Jean-Marie

mowcixo commented 5 years ago

Thanks for the answer @polaije. Closing the issue.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.