Retrieving values from Entity Framework DbContext to render in a ListBox I need to pass a ViewModel to a strongly typed View which will display a multiple-select box using Html.ListBoxFor. My ViewModel has a List&lt;int&gt; for the selected values and an IEnumerable&lt;SelectListItem&gt; for the options.

Is there a better way I could be enumerating the list of options?

private MyDbContext db = new MyDbContext();

public List&lt;int&gt; SelectedPhysicians { get; set; } = new List&lt;int&gt;(1) { 1 };

public IEnumerable&lt;SelectListItem&gt; AllPhysicians
{
    get
    {
        List&lt;SelectListItem&gt; temp = new List&lt;SelectListItem&gt;();
        foreach (PhysicianModel p in db.Physicians)
        {
            temp.Add(new SelectListItem { Value = p.Id.ToString(), Text = p.Name });
        }
        return temp;
    }
}


Also, can you see any long-term reasons I would even need a List&lt;int&gt; rather than an int[]? I tend to go with List because I almost always end up needing more than basic array operations. In this case, however, I'm just retrieving and storing sets of values in the database.
It's occurred to me that all of my models are using Lists for no tangible reason, but I want to be sure before refactoring.
You might as well just use LINQ to project the collection to SelectListItem 

return db.Physicians.Select(new SelectListItem { Value = p.Id.ToString(), Text = p.Name });




As far as lists and arrays are concerned there is actually only one main difference betwen them: arrays cannot change its size. Use what is more conveninet. If you have fixed collection of items the I'd probably use an array an in all other cases I guess I'd chose a list. 

Alternatively you can use ICollection&lt;T&gt; as a return type and since most collections implement this interface it doesn't matter what the underlying type is.