Possible Duplicate:
C# how do I compare two objects if they are of same type?
I have a generic function,
class Something {
public int found;
public Something() {
this.found = true;
}
}
List<Something> something;
public int countFound<T>(List<T> Organisms)
{
if (typeof(T) == typeof(Something))
{
foreach (T organism in Organisms)
{
// here i want to check something like organism.found == true how do i do it?
}
}
return 0;
}
Thanks in advance for all the help!