Use of SelectMany
<p>Here in below code we can show difference between <code>Select</code> and <code>SelectMany</code> operator.</p>

<p>Is there any way to avoid the common skills? For example if two employees have the C# skill then I want to print them only once.</p>

<pre><code>namespace LinqOperators
{
    class Employee
    {
        public string Name { get; set; }
        public List&lt;string&gt; Skills { get; set; }
    }

    class Program
    {
        static void Main(string[] args)
        {
            List&lt;Employee&gt; employees = new List&lt;Employee&gt;();
            Employee emp1 = new Employee { Name = "Deepak", Skills = new List&lt;string&gt; { "C", "C++", "Java" } };//Adding Skills List to Employee List i.e List of List
            Employee emp2 = new Employee { Name = "Karan", Skills = new List&lt;string&gt; { "SQL Server", "C#", "ASP.NET" } };

            Employee emp3 = new Employee { Name = "Lalit", Skills = new List&lt;string&gt; { "C#", "ASP.NET MVC", "Windows Azure", "SQL Server" } };

            employees.Add(emp1);
            employees.Add(emp2);
            employees.Add(emp3);

            // Query using Select()
            IEnumerable&lt;List&lt;String&gt;&gt; resultSelect = employees.Select(e =&gt; e.Skills);

            Console.WriteLine("**************** Select ******************");

            // Two foreach loops are required to iterate through the results
            // because the query returns a collection of arrays.
            foreach (List&lt;String&gt; skillList in resultSelect)
            {
                foreach (string skill in skillList)
                {
                    Console.WriteLine(skill);
                }
                Console.WriteLine();//To differntiate Two Skill Lists
            }

            // Query using SelectMany()
            IEnumerable&lt;string&gt; resultSelectMany = employees.SelectMany(emp =&gt; emp.Skills);

            Console.WriteLine("**************** SelectMany ******************");

            // Only one foreach loop is required to iterate through the results 
            // since query returns a one-dimensional collection.
            foreach (string skill in resultSelectMany)
            {
                Console.WriteLine(skill);
            }

            Console.ReadKey();
        }
    }

} 
</code></pre>