How can I tell which objects in a list have the most in common with another object of the same type?
<p>What I'd like to do is have a collection of objects with properties, and pass in an object to act as a query template. How can I sort or prioritize the objects whose property values have the most in common with a given input object of the same type?</p>

<p>More details:</p>

<pre><code>        List&lt;A&gt; myList = new List&lt;A&gt;() {new A() {b="x"},
                                        new A() {c="r"},
                                        new A() {b="x",c="r"},};

        var myTemplate = new A() {b = "x", c="r"};
</code></pre>

<p>I'd like this example to match on the third item, but in the case where property <code>c</code> is <code>null</code> or <code>"f"</code>, it should return the first and third item. If property <code>c</code> is <code>"r"</code>, but <code>b</code> <code>is</code> <code>null</code> or <code>"f"</code>, it should return the second and third item, because they match on <code>c</code>.</p>
