title: How to compare the same properties of two different class objects in C#?
body: <p>I have two classes A and B which have some properties that are the same. I am looking for a way to compare only the same properties and was hoping if there was some <strong>nuget</strong> package that did this for any type of class.</p>
  
  <p>I don't know how to go about looking for such a nuget package, I already tried using if statements to compare the same properties, but I have a lot of cases like this so it would be easier to use a nuget package to do it.</p>
  
  <p>Also, <strong>it is not possible to include inheritance here</strong>, as the two classes are not logically linked.</p>
  
  <pre><code>class A {
    string title;
    DateTime publishDate;
    string Author;
    int numberOfSales;
  }
  class B {
    DateTime publishDate;
    int numberOfSales;
  }
  </code></pre>
  
  <p>I have already did something like this to compare the two same properties</p>
  
  <pre><code>if (A.publishDate.Equals(B.publishDate)) {
    // Do something
  }
  if (A.numberOfSales == B.numberOfSales) {
    // Do something
  }
  </code></pre>
  
  <p>I would really be grateful if someone could let me know if there is some <strong>nuget</strong> package that would just compare the same properties of the two classes.</p>