using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Operators
{
    class Examples47_48
    {
        public static void ShowDistinctCategories()
        {
            // Listing 10-47
            var categories = Course.Catalog.Select(c => c.Category).Distinct();

            categories.Show();
        }

        public static void CombineWithZip()
        {
            // Listing 10-48
            string[] firstNames = { "Jan", "Artur", "Artur" };
            string[] lastNames = { "Kowalski", "Zieliński", "Wielicki" };
            IEnumerable<string> fullNames = firstNames.Zip(lastNames,
                (first, last) => first + " " + last);
            foreach (string name in fullNames)
            {
                Console.WriteLine(name);
            }
        }
    }
}
