I am having a problem doing the following in generics.
I have one custom type array. Its a struct with few elements in it like id, shortname, longname
Sample data would be
1, a, australia
2, a, asia
3, b, bangkok
The problem im facing is that i want to actually gather all unique shortname
and place it in another List (generic)
I plan to create another new List, and then check whether the
element exists in the new List, if not add it, else, move to the next item
So i plan to make use of the Exists method in generic (List) but
seems like im not sure how to use it since it has predicate.
I hope the above explanation makes sense.
Does anyone have some idea of how I might go about this? Any help
(particularly example code) would be much appreciated.
I have one custom type array. Its a struct with few elements in it like id, shortname, longname
Sample data would be
1, a, australia
2, a, asia
3, b, bangkok
The problem im facing is that i want to actually gather all unique shortname
and place it in another List (generic)
I plan to create another new List, and then check whether the
element exists in the new List, if not add it, else, move to the next item
So i plan to make use of the Exists method in generic (List) but
seems like im not sure how to use it since it has predicate.
I hope the above explanation makes sense.
Does anyone have some idea of how I might go about this? Any help
(particularly example code) would be much appreciated.