Ho do I clear all items in a dictionary?
Hi All,
I am asking a question similar to the one already answered in the question: "How do I clear a DataTable in a Workflow?". I have a system.collections.generic.idictionary<string,FeatureSet>. I want to clear. Since there is no activity that does this I figured the way to go is to use activity Invoke Method .Clear() on the idictionary. Logical but no go. I get an error of "IDictionary`2' does not have a public instance method named 'Clear' matching the parameter types, generic type arguments, and generic type constraints supplied to InvokeMethod 'InvokeMethod'.
TargetType = null, TargetObject = the specfied idictionary, MethodName = Clear, GenericTypeArguements = null, Parameters = null.
What am I missing here? Anyone know a better way to clear out a dictionary without deleting it and recreating it?
Thanks,
Wiley
Wiley Osborn
County of Contra Costa, CA
Public Works
0
-
Also , if this helps, the dictionary is created in the Variables as "new Dictionary (of string, featureset)" with variable type of System.Collections.Generic.IDictionary<String,FeatureSet> 0 -
Figured it out, I used ClearCollection activity. The type argument is KeyValyePair<String.FeatureSet>.
Wiley0
Please sign in to leave a comment.
Comments
2 comments