title: ASP.NET MVC 5 - Scaffolding for Many to One Relationship
body: <p>I am Working on ASP.NET MVC 5, EF 6, Razor Engine, VB Language and Database First Approach with VS 2013.</p>
  
  <p>Now, in my DB; I have two tables as below:</p>
  
  <pre><code>CREATE TABLE [dbo].[Group]
  (
      [Id]    INT          NOT NULL PRIMARY KEY IDENTITY(1, 1), 
      [Name]  VARCHAR(50)  NOT NULL
  )
  </code></pre>
  
  <p>and </p>
  
  <pre><code>CREATE TABLE [dbo].[Subscriber]
  (
      [Id]          INT              NOT NULL  PRIMARY KEY IDENTITY(1, 1),
      [FirstName]   [nvarchar](100)  NOT NULL,
      [MiddleName]  [nvarchar](100)  NULL,
      [LastName]    [nvarchar](100)  NOT NULL, 
      [Email]       [varchar] (200)  NOT NULL  UNIQUE, 
      [GroupId]     INT              NULL      REFERENCES [Group] ON DELETE SET NULL
  )
  </code></pre>
  
  <p>Now, when I autogenerate the Controllers and Views using <strong>Scaffolding</strong>; I get a &lt;select&gt; control (with all <code>Group</code> items as &lt;option&gt; inside) in "Create Subscriber" and "Edit Subscriber" views.</p>
  
  <p>But actually, I want the "Create Group" and "Edit Group" views to ask me the <code>Subscribers</code> I want to add in the particular group. The HTML control for the same can be a <strong>list of checkbox</strong> or <strong>&lt;select multiple="multiple"&gt;</strong> with all <code>Subscriber</code> items as &lt;option&gt;s.</p>
  
  <p>How can I autgenerate/implement that? </p>