How can I add a function that returns class reference data into my c# class?
<p>I have the following class:</p>

<pre><code>public class Content {
    public int Key { get; set; }
    public int Order { get; set; }
    public string Title { get; set; }
}
</code></pre>

<p>I have the following function that returns a content type code depending on an id. </p>

<pre><code>protected string getType(string id) {
    switch(id.Substring(2, 2)) {
        case "00": return ("14");
        case "1F": return ("11");
        case "04": return ("10");
        case "05": return ("09");
        default: return ("99");
    }
}
</code></pre>

<p>Although the id is not part of the content class the class and function are always used together.</p>

<p>Is there some way I could cleanly fit this function into my class? I was thinking of an enum or something fixed however my knowledge of C# isn't really good enough for me to know how I could do this. I hope someone can give me and example.</p>

<p><strong>Update:</strong></p>

<p>I like the following suggestion:</p>

<pre><code>public static readonly Dictionary&lt;String, String&gt; IdToType = 
    new Dictionary&lt;string, string&gt;
    {
        {"00", "14"},
        {"1F", "11"},
        {"04", "10"},
        {"05", "09"},
        //etc.
    };
</code></pre>

<p>but I don't know how I could fit this into my class. Is there anyone out there who could show me? What I would like to be able to do is write something like this:</p>

<pre><code>Content.getType("00")
</code></pre>

<p>With data stored in the dictionary as suggested.</p>
