Zum Hauptinhalt gehen

how do you create a distinct list from a dataitem list?

Kommentare

1 Kommentar

  • Zack Robison
    I did not come up with an inline answer, so I wrote a bunch of workflow logic around the issue.  

     

    So, I ended up checking for duplication as I populate the list while iterating a featureSet.  I created a boolean variable set to true which will determine whether to add a given dataItem, then loop through the list itself(parallel foreach inside of a while which watches the boolean) and check the values of each dataItem in the list already against the new one made from a given feature.  Matches set the boolean to false, ending the loop.  The activity to insert the dataItem is within an if activity checking the boolean, so only non-dups get added.

     

    If the list is already generated, the same logic will work but you'll need a new list of dataitems.

     

    Would love to see a more elegant solution, this feels like unneeded code that could become problematic with large lists.
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.