S
sianan
I am having a problem doing the following in generics.
I have two list of a custom item type. I need to iterate through the
first list and match each item against another list to see if there is
a match. If a match is found, I need to move the matched item into
another list.
I want to compare the objects by value. The items in each list have an
ID property (of type object) which I want to convert to a strng in
order to be able to do this.
I cannot use the Contains method to perform this check. Contains has
been overridden. I also run the risk of breaking the control (which
someone else wrote) if I modify this behavior.
I hope the above explanation makes sense.
I know that I can create a method which will be used as a predicate to
check for the specified condition (a match) but I have been unable to
get the syntax right.
Does anyone have some idea of how I might go about this? Any help
(particularly example code) would be much appreciated.
I have two list of a custom item type. I need to iterate through the
first list and match each item against another list to see if there is
a match. If a match is found, I need to move the matched item into
another list.
I want to compare the objects by value. The items in each list have an
ID property (of type object) which I want to convert to a strng in
order to be able to do this.
I cannot use the Contains method to perform this check. Contains has
been overridden. I also run the risk of breaking the control (which
someone else wrote) if I modify this behavior.
I hope the above explanation makes sense.
I know that I can create a method which will be used as a predicate to
check for the specified condition (a match) but I have been unable to
get the syntax right.
Does anyone have some idea of how I might go about this? Any help
(particularly example code) would be much appreciated.