title: Modify an element of a dictionary before removing it
body: <p>I need to delete a element of an dictionary collection, but before I delete it, I should change an attribute of its object.</p>
  <pre><code>class ColeccionAlquileres
  {
      //creation of the collection        
      Dictionary&lt;int, Alquiler&gt; alquileres = new Dictionary&lt;int, Alquiler&gt;();
  
      //method implementation
      public int BajaAlquiler(int _identificador)
      {
          if (alquileres.Remove(_identificador))
          {
              Console.WriteLine(&quot;Articulo dado de baja&quot;);
              //here, the code that allow change the atribute of my object.
          }
          else throw new AlquilerInexistenteException();
      }
  }
  </code></pre>