Union Linq method not working

I have two Ienumerable

IEnumerable<int> a = Enumerable.Range(5,5); // 5,6,7,8,9
IEnumerable<int> b = Enumerable(){2,3}; // 3

var c = a.Union(b)

c should be 2,3,5,6,7,8,9 but I only get 5,6,7,8,9

I just need the two of them joined.

Answers


Just make your code compilable

IEnumerable<int> a = Enumerable.Range(5,5); // 5,6,7,8,9
IEnumerable<int> b = Enumerable.Range(2,3); // 2,3,4

var c = a.Union(b).ToList();

and you will get 5,6,7,8,9,2,3,4


Need Your Help

Post to an API using OAuth

ruby-on-rails ruby api oauth

I'm trying to post to an API. The API takes files and converts them to JSON

Using AutoMapper to map from XElement to a strongly typed class?

c# .net automapper

Can I use AutoMapper to map from data in an XElement to my own type ? How ?