I want to know the most efficient way of comparing two entities of the same type.
One entity is created from an xml file by hand ( ie new instance and manually set p
Override the Equals method of your object and write an implementation that compares the properties that make it equal.
public override bool Equals(object obj) { return MyProperty == ((MyObject)obj).MyProperty }