title: Create the relationship table between 2 tables in asp.net mvc EF
body: <p>I created:</p>
  
  <ul>
  <li>custom custom membership provider</li>
  <li>custom role provider</li>
  <li>an user model</li>
  <li>an role model</li>
  </ul>
  
  <p>It create me the 2 custom tables correctly.
  Now I want to create the table between Users and Roles with 2 columns: RoleId, UserId</p>
  
  <p>I should I tweak my models to teach to EF to create this relationship table (UsersInRole)?</p>
  
  <p>User model:</p>
  
  <pre><code> public class User
  {
  
      [Key]
      public int UserId { get; set; }
  
      [Required]
      public Int32 CompanyId { get; set; }
  
      [Required]
      public String UserName { get; set; }
  
      public String Password { get; set; }
  
      public String PasswordSalt { get; set; }
  
      public String Email { get; set; }
  
      public Boolean IsApproved { get; set; }
  
      public Boolean IsLockedOut { get; set; }
  
      public DateTime CreateDate { get; set; }
  
      public DateTime LastLoginDate { get; set; }
  
      public DateTime LastPasswordChangedDate { get; set; }
  
      public DateTime LastLockoutDate { get; set; }
  
  }
  </code></pre>
  
  <p>Role model:</p>
  
  <pre><code>public class Role
  {
  
      [Key]
      public int RoleId { get; set; }
  
      [Required]
      [MaxLength(20)]
      public string Name { get; set; }
  
      public ICollection&lt;string&gt; AssignedUsers { get; set; }
  
  }
  </code></pre>