title: Cannot insert explicit value for identity column in table when IDENTITY_INSERT is set to NULL
body: <p>Here is my function to add a row in db:</p>
  
  <pre><code>    public static void insertNote(string title, string text, int languageId)
      {
          var dbo = new UsersContext();
          Models.NoteForm note = new NoteForm
          {
              Text = text,
              Title = title,
              languageId = languageId,
              userId = WebSecurity.CurrentUserId
          };
          dbo.Note.Add(note);
          dbo.SaveChanges();
  
      }
  </code></pre>
  
  <p>And the model used:</p>
  
  <pre><code>public class NoteForm
  {
      [Required]
      [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
      [Display(Name = "Title")]
      public string Title { get; set; }
  
      [Required]
      [Display(Name = "Text")]
      public string Text { get; set; }
  
      [Required]
      [Display(Name = "Language")]  
      public int languageId { get; set; }
      [ForeignKey("id")]
      public virtual Language language { get; set; }
  
      [Key]
      public int id { get; set; }
  
      public int userId { get; set; }
  
  }
  </code></pre>
  
  <p>At this line :</p>
  
  <pre><code>dbo.SaveChanges();
  </code></pre>
  
  <p>i get this error:</p>
  
  <blockquote>
    <p>Cannot insert explicit value for identity column in table when 
    IDENTITY_INSERT is set to NULL</p>
  </blockquote>
  
  <p>With the debugger i see that the language property </p>
  
  <pre><code> public virtual Language language { get; set; }
  </code></pre>
  
  <p>is set to null. that's probably the reason why i get this error.
  How could i solve this problem ? I can't initialize this property, i just use it to navigate through a table.
  Thanks in advance</p>