title: How can I make a List(main) of Lists of Objects correctly so that when an item is added to a list, it is not added to all the lists in the List(main)?
body: <p>I have this:</p>
  <pre><code>public sealed class RepositoryContacts
  {
       public List&lt;List&lt;Template&gt;&gt; Contacts = new List&lt;List&lt;Template&gt;&gt;();
  
       public List&lt;Template&gt; PersonalContacts = new List&lt;Template&gt;();
       public static RepositoryContactacts Instancia = new RepositoryContactacts();
       private RepositoryContacts() { }
  }
  </code></pre>
  <p>Suppose I added two Listings in Contacts, something like this:</p>
  <pre><code>PlantillaContactos contact = new PlantillaContactos 
  {
      Name= &quot;&quot;,
      LastName= &quot;&quot;,
      Address= &quot;&quot;,
  };
  RepositoryContacts.Instancia.PersonalContacts.Add(contact);
              
  RepositoryContacts.Instancia.Contacts.Add(RepositoryContacts.Instancia.PersonalContacts);
  RepositoryContacts.Instancia.PersonalContacts.Clear();
  RepositoryContacts.Instancia.Contacts[RepositoryContacts.Instancia.Contacts.Count - 1].Clear();
  </code></pre>
  <p>All good so far, the last two lines are to clean up the content of the lists since it was initialized inside Contacts. Now when I really want to add an item to a list, they are added in all the lists it has inside. This is what I do:</p>
  <pre><code>public void Add(string name, string lastname, string address) 
  {
      PlantillaContactos contacto = new PlantillaContactos 
      {
          Name= name,
          LastName= lastname,
          Address= address,
      };
      RepositoryContacts.Instancia.PersonalContacts.Add(contacto);
      RepositoryContacts.Instancia.Contactos[index] = RepositoryContacts.Instancia.PersonalContacts;
  }
  </code></pre>
  <p>The value of the variable &quot;index&quot;, will vary depending on the list you want to get (I already tested it).</p>
  <p>Note: I will create all this for your next serialization.</p>