locked
Useless RemoveFromCollection<T> activity ? RRS feed

  • Question

  • Hi,

    Am I wrong or the RemoveFromCollection<T> activity is useless? This activity has only one return argument of type bool. After removing the specified element from the designated collection it forgets to return the updated collection back to user. Shouldn't the Collection property be of type InOutArgument<ICollection<T>> ? Has anyone else used this activity ?
    Wednesday, February 3, 2010 6:53 PM

Answers

  • Hi there.
    The RemoveFromCollection Result just returns a bool as to whether or not the item was successfully removed or not.
    The common usage for this is to create a Collection<> as a Variable in the workflow and then pass that into a the RFC activity as an InArgument.  The Collection Variable will be modified and available to the activities within the scope that it was declared.

    This is demonstrated in the sample:  WF_WCF_Samples\WF\Basic\Built-InActivities\Collection.

    Thanks!
    Scott
    MS Developer Support
    Wednesday, February 3, 2010 10:39 PM