title: Creating Entity Model with Cross Referencing Table
body: <p>Here are my models:</p>
  
  <pre><code>public partial class NEWS
  {
      public NEWS()
      {
      }
      [Key]
      public int NEWSID { get; set; }
      public string Title { get; set; }
      public string Text { get; set; }
      public string InsertDate { get; set; }
      public int GroupingID { get; set; }
      public virtual Subjects Subjects { get; set; }
  
  }
  
  public partial class Subjects
  {
      public Subjects()
      { this.NEWSs = new HashSet&lt;NEWS&gt;(); }
      [Key]
      public int GroupingID { get; set; }
      public string Farsi { get; set; }
      public string Latin { get; set; }
  
      public virtual ICollection&lt;NEWS&gt; NEWSs { get; set; }
  }
  
  public class UserGroup
  {
  
      public UserGroup()
      { this.Userss = new HashSet&lt;Users&gt;(); }
      [Key]
      public int UserID { get; set; }
      public string Title { get; set; }
      public virtual ICollection&lt;Users&gt; Userss { get; set; }
  }
  
  public class Users
  {
      public Users()
      { }
      public string Name { get; set; }
      public string Family { get; set; }
      public string Email { get; set; }
      public string UserName { get; set; }
      public string PassWord { get; set; }
      [Key]
      public int UserID { get; set; }
      public virtual UserGroup UserGroup { get; set; }
  
      // public HashSet&lt;Users&gt; Userss { get; set; }
  }
  
  public class NEWSDBContext : DbContext
  {
      public NEWSDBContext()
          : base()
      {
          Database.SetInitializer&lt;NEWSDBContext&gt;(null);
      }
      public DbSet&lt;NEWS&gt; NEWSs { get; set; }
      public DbSet&lt;Users&gt; Userss { get; set; }
      public DbSet&lt;UserGroup&gt; UserGroups { get; set; }
      public DbSet&lt;Subjects&gt; Subjectss { get; set; }
  }
  </code></pre>
  
  <p>I always get an error in <code>return View(newss.ToList());</code>:</p>
  
  <pre><code>The underlying provider failed on Open
  </code></pre>