public void Compare3(CompareTestB B, CompareTestBInherited Binherited)
 {
     if (B == Binherited)
     {
         //Equals
     }
 }
 public void Compare2(CompareTestA A, CompareTestB B)
 {
     if (A.Equals(B))
     {
         //Equals
     }
 }
 public void Compare1(CompareTestA A, CompareTestB B)
 {
     //Never: if (A == B) { }
     if ((object)A == (object)B)
     {
         //Equals
     }
 }
        public override bool Equals(object obj)
        {
            CompareTestB B_1 = (CompareTestB)obj; //Be careful!
            CompareTestB B   = obj as CompareTestB;

            if (B != null)
            {
                return(B.MyProperty == this.MyProperty);
            }

            return(base.Equals(obj));
        }