When we assign a List object to another it does a shallow copy, and making a change into copied object reflects in source object as well. This does not serves the purpose, thus finding a ways is through extension methods.

Code Snippet
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Csharp
  9. {
  10.  
  11.     public static class Program
  12.     {
  13.  
  14.  
  15.         static void Main(string[] args)
  16.         {
  17.             List<string> abc = new List<string>();
  18.             abc.Add("a");
  19.  
  20.             var newList = AddAlphabet(abc);
  21.  
  22.             Console.WriteLine(abc.Count);
  23.             Console.WriteLine(newList.Count);
  24.             Console.ReadLine();
  25.         }
  26.  
  27.         private static List<string> AddAlphabet(List<string> abc)
  28.         {
  29.             List<string> _abc = abc;
  30.             _abc.Add("d");
  31.             _abc.Add("e");
  32.             return _abc;
  33.         }
  34.  
  35.  
  36.         
  37.     }
  38. }

This produces following result in output

3

3

Changing the code and added an extension method will result in proper result that I expected earlier.

Code Snippet
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Csharp
  9. {
  10.  
  11.     public static class Program
  12.     {
  13.         public static IEnumerable<T> Clone<T>(this IEnumerable<T> collection) where T : ICloneable
  14.         {
  15.             return collection.Select(item => (T)item.Clone());
  16.         }
  17.  
  18.         static void Main(string[] args)
  19.         {
  20.             List<string> abc = new List<string>();
  21.             abc.Add("a");
  22.  
  23.             var newList = AddAlphabet(abc.Clone<string>().ToList());
  24.  
  25.             Console.WriteLine(abc.Count);
  26.             Console.WriteLine(newList.Count);
  27.             Console.ReadLine();
  28.         }
  29.  
  30.         private static List<string> AddAlphabet(List<string> abc)
  31.         {
  32.             List<string> _abc = abc;
  33.             _abc.Add("d");
  34.             _abc.Add("e");
  35.             return _abc;
  36.         }
  37.  
  38.  
  39.         
  40.     }
  41. }

This produces following result in output

1
3

We notice that it does not change the original value of source.