title: How to query a table column into an array with LINQ
body: <p>I am just trying to use multiselect options in MVC by using ListBoxFor. I created my viewmodel and passing that viewmodel to view. But I found out that I need to create an array list to pass to view and when the results is posted back to controller I will be able to find out what has been selected and save those in the table. So I have a table called ArtistTypes and I would like to get the array list of artistTypeID from this table and pass it to view. I cannot figure it out how to query it to an array?</p>
  
  <pre><code>int[] selectedIds = _db.ArtistTypes.ToList().Select(x=&gt; new int[]???);
  </code></pre>