Get the all the values of DisplayName attributes
<p>I'm using asp.net MVC 5 with EntityFramework 6 DataAnnotations.
I would like to know if there is a way to get all <code>DisplayName</code> of an object and save them in a variable into a Controller class.</p>

<p>For example, considering the class:</p>

<pre><code>public class Class1
{
    [DisplayName("The ID number")]
    public int Id { get; set; }

    [DisplayName("My Value")]
    public int Value { get; set; }

    [DisplayName("Label name to display")]
    public string Label { get; set; }
}
</code></pre>

<p>How to get the values of <code>DisplayName</code> for all attributes? For example how to create a function that returns a <code>Dictionary&lt; string,string &gt;</code> which has a key with attribute name and value with <code>DisplayName</code>, like this: </p>

<pre><code>{ "Id": "The ID name", "Value": "My Value", "Label": "Label name to display"}.
</code></pre>

<p>I have seen this topic <a href="https://stackoverflow.com/questions/5015830/get-the-value-of-displayname-attribute">stackoverflow - get the value of DisplayName attribute</a> but I have no ideas of a way to extends this code.</p>