If I have an object of type MyBull and a List:
// Just an example
MyBull x = getMeTheObjectWithIdFromDB(9);
ori
If you can use LINQ then you can
class Vessel
{
public int id { get; set; }
public string name { get; set; }
}
...
var vessels = new List() { new Vessel() { id = 4711, name = "Millennium Falcon" } };
var ship = new Vessel { id = 4711, name = "Millencolin" };
if (vessels.Any(vessel => vessel.id == ship.id))
Console.Write("There can be only one!");