Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Can't you use <code>Enumerable.Except</code> ?</p> <blockquote> <pre><code>public static IEnumerable&lt;TSource&gt; Except&lt;TSource&gt;( this IEnumerable&lt;TSource&gt; first, IEnumerable&lt;TSource&gt; second ) </code></pre> </blockquote> <p>More <a href="http://msdn.microsoft.com/en-us/library/bb300779.aspx" rel="nofollow noreferrer">details</a>.</p> <p>An example tested in <a href="http://www.sliver.com/dotnet/SnippetCompiler/" rel="nofollow noreferrer">Snippet Compiler</a></p> <pre><code>using System; using System.Linq; using System.Collections.Generic; class ColumnDefinition : IEquatable&lt;ColumnDefinition&gt; { public string Name { get; set; } public string Type { get; set; } public string Attr { get; set; } public ColumnDefinition() { Name = string.Empty; Type = string.Empty; Attr = string.Empty; } public bool Equals(ColumnDefinition other) { return Name.Equals(other.Name) &amp;&amp; Type.Equals(other.Type) &amp;&amp; Attr.Equals(other.Attr); } public override bool Equals(object value) { return (value is ColumnDefinition) ? Equals(value as ColumnDefinition) : false; } public override int GetHashCode() { return Name.GetHashCode() ^ Type.GetHashCode() ^ Attr.GetHashCode(); } public override string ToString() { return string.Concat("{", Name, ":", Type, ":", Attr, "}"); } } public class Program { public static void Main(string[] args) { try { MyMain(args); } catch (Exception e) { Console.WriteLine(e); } finally { Console.ReadKey(); } } public static void MyMain(string[] args) { var list1 = new [] { new ColumnDefinition { Name = "foo", Type = "int", Attr = "0" }, new ColumnDefinition { Name = "bar", Type = "int", Attr = "1" }, }; var list2 = new [] { new ColumnDefinition { Name = "foo", Type = "int", Attr = "0" }, new ColumnDefinition { Name = "bar", Type = "string", Attr = "1" }, }; foreach (var changed in Enumerable.Except(list1, list2)) { Console.WriteLine(changed); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload