I believe you are talking about sets. you have 2 options.
1. use a set instead of a list/bag. by definitions sets will contain
uniquely identified objects
if(set.Add(item))
{
//item was added
}
else
{
//item was not added
}
2. check to make sure it does not already exist. which is basically what
set is doing
if(list.Contains(item)) return;
list.Add(item);
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/nhusers/-/iLcAW4ssy2MJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.