title: How to add a table reference to an entry in another table in asp.net mvc?
body: <p>I have to create a website where users can log in and create and share music playlists. I'm using Asp.net MVC with C# in Visual Studio. </p>
  
  <p>Each playlist is an entry in the playlists table and has the fields PlaylistName, UserId (id of the user the playlist belongs to), and list of tracks in the playlist in either the form of a vector (the vector contains IDs to tracks contained the tracks table) or in the form of a reference to a table that contains the tracks associated with this playlist (so each playlist entry in the playlists table has its own table). Being new to ASP.NET and databases in general I'm not really sure if either of these approaches are ideal and even how to implement them. If I went with the vector method could I do this:</p>
  
  <pre><code>namespace MvcApplication1.Models
  {
      public class Playlist
      {
          public string PlaylistName { get; set; }
          public int UserId { get; set; }
          public List&lt;int&gt; Tracks { get; set; }
      }
  
      public class PlaylistDBContext : DbContext
      {
          public DbSet&lt;Playlist&gt; Playlists { get; set; }
      }
  }
  </code></pre>
  
  <p>And then scaffold the model?</p>
  
  <p>For the other method I'm not sure how to use visual studio to set that up. </p>