title: Invalid column name on database table
body: <p>Some help here pls. I cant figure out why this error.</p>
  
  <p>Invalid column name 'Blogs_Id1'.
  Invalid column name 'Blogs_Id1'.
  Invalid column name 'Blogs_Id1'. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
  
  <p>Exception Details: System.Data.SqlClient.SqlException: Invalid column name 'Blogs_Id1'.
  Invalid column name 'Blogs_Id1'.
  Invalid column name 'Blogs_Id1'.</p>
  
  <p>Source Error: </p>
  
  <p>Line 84: 
  Line 85:         @{
  Line 86:             foreach (var comment in Model.Comments) {...</p>
  
  <p>Here is my model </p>
  
  <pre><code> public class Blogs
  {
      public  int Id { get; set; }
      [Required, Display(Name = "Title"), MaxLength(100, ErrorMessage = "The {0}  should be 100   characters maximum"), MinLength(10, ErrorMessage = "The {0} is too short!")]
      public string BlogTitle { get; set; }
      [Required, Display(Name ="Post description"),StringLength(500,ErrorMessage ="{0} too large. Should be maximum of 400 characters"),AllowHtml]
      public string Description { get; set; }
      [Required,MinLength(50,ErrorMessage ="The {0} should be a minimum of 50 characters"),AllowHtml]
  
      public string Body { get; set; }
      public DateTime PostDate { get; set; }
      public string Author { get; set; }
      public string PostImage { get; set; }
      public virtual  ICollection&lt;Comments&gt; Comments { get; set; }
  } 
  
   public class Comments
  {
      public int Id { get; set; }
      public string Username { get; set; }
      public DateTime Date { get; set; }
      [MaxLength(400, ErrorMessage = "Too many characters in comments. Please limit it to 400 characters"), Required]
      public string Comment { get; set; }
  
      public int Blogs_Id { get; set; }
  }
  </code></pre>
  
  <p>Here is my database code </p>
  
  <pre><code>CreateTable(
              "dbo.Blogs",
              c =&gt; new
                  {
                      Id = c.Int(nullable: false, identity: true),
                      BlogTitle = c.String(nullable: false, maxLength: 100),
                      Description = c.String(nullable: false, maxLength: 500),
                      Body = c.String(nullable: false),
                      PostDate = c.DateTime(nullable: false),
                      Author = c.String(),
                      PostImage = c.String(),
                  })
              .PrimaryKey(t =&gt; t.Id);
  
          CreateTable(
              "dbo.Comments",
              c =&gt; new
                  {
                      Id = c.Int(nullable: false, identity: true),
                      Username = c.String(),
                      Date = c.DateTime(nullable: false),
                      Comment = c.String(nullable: false, maxLength: 400),
                      Blogs_Id = c.Int(),
  
                  })
              .PrimaryKey(t =&gt; t.Id)
              .ForeignKey("dbo.Blogs", t =&gt; t.Blogs_Id)
              .Index(t =&gt; t.Blogs_Id);
  </code></pre>
  
  <p>The Blogs and Comments tables successfully created. however, when I want to access the post detail where a I intend to display the comments too, the error above keeps coming.</p>
  
  <p>for reference, here is the view code (The comments part)</p>
  
  <pre><code>@{
          foreach (var comment in Model.Comments) { 
  
      &lt;div class="media"&gt;
  
          &lt;div class="media-body"&gt;
              &lt;img src="~/images/user.png" width="200" height="200" style="margin: 0 15px 15px 0; float:left" alt="user" title="@comment.Username" /&gt;
              &lt;h4 class="media-heading"&gt;
  
                  @comment.Username
                  &lt;small&gt;@comment.Date.ToLongDateString()&lt;/small&gt;
              &lt;/h4&gt;
              @comment.Comment
          &lt;/div&gt; 
      &lt;/div&gt;
      }}
  </code></pre>
  
  <p>Thanks for help</p>