Passing property as parameter in method
<p>I know the title could probably be a bit more descriptive/better phrased, but it was the best I could come up with. </p>

<p>Currently I have a class with a lot of methods looking like the ones below:</p>

<pre><code>        private static void UpdateArtists()
        {
            artists.Clear();
            foreach (AudioInfo entry in library_entries)
            {
                artists.Add(entry.Artist, entry);
            }
        }

        private static void UpdateAlbums()
        {
            albums.Clear();
            foreach (AudioInfo entry in library_entries)
            {
                albums.Add(entry.Album, entry);
            }
        }

        private static void UpdateGenres()
        {
            genres.Clear();
            foreach (AudioInfo entry in library_entries)
            {
                genres.Add(entry.Genre, entry);
            }
        }

        private static void UpdateYears()
        {
            years.Clear();
            foreach (AudioInfo entry in library_entries)
            {
                years.Add(entry.Year, entry);
            }
        }
</code></pre>

<p>Needless to say, writing dozens of these is very tiresome. So I was wondering if it's possible to simplify it and make a method something like this:</p>

<pre><code>     private static void Update(Dictionary&lt;string, AudioInfo&gt; dictionary, AudioInfo.Property property)
     {
         dictionary.Clear();
         foreach (AudioInfo entry in library_entries)
         {
             dictionary.Add(entry.property, entry);
         }
         //Where "property" is a property in the AudioInfo-class.
     }
</code></pre>

<p>Is that doable, and if it is; how?</p>

<p>Thanks!</p>
