Why Does SfDropDownBase.AddItem take an IEnumerable as a parameter?

Hi, just in case I am missing something, can you please let me know why the function SfDropDownBase.AddItem (singular) requires an IEnumerable items (plural) as a parameter please?

public Task AddItem(IEnumerable<T> items, int? itemIndex = null);

The function is named "AddItem" (which indicates adding a single item) yet the input parameter is called "items" which is plural / indicates multiple items to be added?




3 Replies

JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team March 1, 2021 10:28 AM UTC

Hello Jeremy, 

Greetings from Syncfusion support.

We have checked your query related to the AddItem() method. We would like to thank you for the detailed explanation which helped us to understand your query much better. We would like to aware you that you can also create single list item using the AddItem() method not only multiple items. Therefore we have followed this naming convention.

Please let us know if you need any further assistance .

Regards, 
Jeyanth. 



JE Jeremy March 2, 2021 07:33 AM UTC

Hi Jeyanth,

If I create a list with six items, and pass this into the function "addItem", have I added a single item, or have I added multiple items?


JM Jeyanth Muthu Pratheeban Sankara Subramanian Syncfusion Team March 3, 2021 10:11 AM UTC

Hello Jeremy, 
Good day to you.

We have considered your request and we will change this naming convention of AddItem method. We would like to thank you for providing your suggestion and helping us to improve our products. This change will be reflected in any of our upcoming releases. 

Regards, 
Jeyanth. 


Loader.
Up arrow icon