How can I check a parameter matches a value in my enum in C#?
<p>I have this enum:</p>

<pre><code>public enum ContentKey {
    Menu = 0,
    Article = 1,
    FavoritesList = 2
};
</code></pre>

<p>This action method:</p>

<pre><code>public ActionResult Edit(string pk, string rk, int row = 0) {
    try {
        var content = _contentService.Get(pk, rk);
</code></pre>

<p>The following class <code>Content</code> which is based on the <code>TableServiceEntity</code>. Note that <code>TableServiceEntity</code> is common to all my data classes. </p>

<pre><code>public class Content : TableServiceEntity 
{

public abstract class TableServiceEntity
{
    protected TableServiceEntity();
    protected TableServiceEntity(string partitionKey, string rowKey);
    public virtual string PartitionKey { get; set; }
</code></pre>

<p>Is there a way I can check the value of <code>pk</code> matches one of the enum values? What I am not sure about is how I can check this. I assume I need to have the check in the <code>Content</code> class but I am not sure how to override the <code>virtual string</code> and throw an exception when there's no match.</p>

<p><strong>Update</strong>: If possible I would like to do this in the Content class get set but I am not sure how to add a get set to this class.</p>
