using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AbundantcodeConsoleApp
{
internal class Program
{
private static void Main(string[] args)
{
List<string> Names = new List<string>();
Names.Add("Abundantcode.com");
Names.Add("Tutorial Website");
List<string> clonedList = Names.CloneList().ToList();
foreach (var item in clonedList)
Console.WriteLine(item);
Console.ReadKey();
}
}
internal static class Extensions
{
public static IList<T> CloneList<T>(this IList<T> list) where T : ICloneable
{
return list.Select(item => (T)item.Clone()).ToList();
}
}
}