Hi,
I've got a list of objects.
The objects have 2 properties, id and name.
I've returned a sql query to get a list of values which make up these objects.
I want to populate a List<my objects> but would like to test to see if an object I've created has a porperty of an item that already exists in the List.
Example:
List<myobject> myListOfMyObjects = new List<myobject>();
foreach(item in sqlQueryResult)
{
myobject bob = new myobject();
bob.id=item.id;
bob.name=item.name;
if(myListOfMyObjects.contains(bob)==false)
{
myListOfMyObjects.add(bob);
}
}
So I create an instance of my object, test to see if it's in the list already, and if it's not, add it.
However, I'm seeing that my instance of the object (bob in this example) is being added multipel times.
I'm guessing that this is because somewhere in the b ...
Go to the complete details ...