MVC5: Iterate ViewModel
<p>In my viewmodel, along with some other properties, I have this:</p>

<pre><code>public int AuthorStatus {get; set;}

public string AuthorStatusLabelClass
{
    get
    {
        switch (AuthorStatus)
        {
            case 1:
                return "label-success";
            case 0:
                return "label-danger";
            case 2:
                return "label-warning";
            default:
                return "label-default";
        }
    }
    set
    {

    }
}

public IQueryable&lt;VM_Authors&gt; AuthorList { get; set; }
</code></pre>

<p>How can I access the AuthorStatusLabelClass in my controller;</p>

<pre><code>    var vm = new ViewModels.VM_Authors();
    vm.Categories = new SelectList(db.AuthorCategories, "CategoryID", "CategoryName");
    vm.AuthorList = (from a in db.Authors
                     select new ViewModels.VM_Authors
                     {
                         FirstName = a.FirstName,
                         LastName = a.LastName,
                         Email = a.Email,
                         AuthorStatusLabelClass = ####HOW_SHOULD_I_RETRIEVE_IT_HERE####
</code></pre>

<p>So that I can use it in my view like this:</p>

<pre><code>        @foreach (var item in Model.AuthorList)
        {
        &lt;tr&gt;
            &lt;td&gt;&lt;span class="label @item.AuthorStatusLabelClass"&gt;@item.AuthorStatus&lt;/span&gt;&lt;/td&gt;
            &lt;td&gt;&lt;img src="" class="img-circle" /&gt;&lt;/td&gt;
            &lt;td&gt;&lt;span class="text-semibold"&gt;@item.FirstName @item.LastName&lt;/span&gt;&lt;/td&gt;
            &lt;td&gt;@item.SelectedCategoryID&lt;/td&gt;
            &lt;td&gt;&lt;/td&gt;
        &lt;/tr&gt;
        }
</code></pre>

<p>May be my whole approach is different? Any help would be appreciated!</p>