Mogambo
December 10, 2019, 8:16am
1
Hi, I am trying to add arguments (strings) to a Systems.Collections.Generic.IEnumerable<System.String>. My ultimate purpose is to add this collection as a variable attachments for a Send Exchange Mail Message activity.
I have tried a loop to iterate through the folder + an invoke Method, however it did not work, as the “Add” is not part of IEnumerable.
Could you please help me here?
Thanks in advance!
IEnumerable is only to view the contents of a collection.
If you really want to add, convert the collection to List and then add items to the list.
if items is IEnumerable collection, for converting to list -
lstItems = items.ToList
Regards,
Karthik Byggari
1 Like
sarathi125
(Parthasarathi)
December 10, 2019, 8:29am
3
@Mogambo ,
The IEnumerables are only for enumerating.
You can’t add item to them directly and you should add the item to it’s underlying source instead.
1 Like
Mogambo
December 10, 2019, 8:32am
4
Dear @sarathi125 , thanks for the quick reply, you mean to create a list of strings, and then convert it to IEnumerable?
Could you please show me an example of what you mean?
Thanks so much!
sarathi125
(Parthasarathi)
December 10, 2019, 8:36am
5
@Mogambo ,
No need to convert it. [ List<T>
] implements the [ IEnumerable<T>
] interface so it is already an enumerable.
2 Likes
system
(system)
Closed
December 13, 2019, 8:38am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.