What's the best way to get a bug in a .Net Framework resolved?
A:
Try this:
Console.WriteLine(
new int[] { 2, 2, 3, 3, 4, 4 }
.Except(new int[] { 3 })
.Select(a => a.ToString())
.Aggregate((a, b) => String.Format("{0}, {1}", a, b))
);
Instead of getting "2, 2, 4, 4"
you get "2, 4"
...
CloudSurfer
2009-11-26 16:25:02
You have misunderstood the meaning of `Enumerable.Except`. `Enumerable.Except` produces the set difference of two enumerations (of the same type). So the result of `new int[] { 2, 2, 3, 3, 4, 4 }.Except(new int[] { 3 })` is the sequence `{2, 4}`. This is by definition of `Enumerable.Except`. As another example, the result of `new int[] { 2, 2 }.Except(new int[] { })` is `{ 2 }`, not `{2, 2}`. There is no a bug here.
Jason
2009-11-26 16:43:36
This is probably the most common bug type seen by the connect guys...
Andrei Rinea
2010-06-14 13:49:24