I have two lists and I want to get the list which is the disjoint union of two lists. That is, all the items in either list that are not in both of them.
This post has almost the same query as mine, except they mean something slightly different by Disjoint Union: Disjoint Union in LINQ
what's wrong with this code snippet?
var list1 = new List<int>(){1, 2, 3}
var list2 = new List<int>(){2, 3, 4}
var intersection = list1.Intersect(list2);
list1.AddRange(list2);
list1.RemoveRange(intersection);
I'm getting type conversion issues