Entity Framework CTP 4. “Cannot insert the value NULL into column” – Even though there is no NULL value

i have the same issue here and it’s really an ugly solution.

 [Key]
public Int64 PolicyID { get; set; }

this is NOT an auto generated number

then i hit the same error.

EF Code First CTP5

after apply this:

 [Key]
 [DatabaseGenerated(DatabaseGeneratedOption.None)]
 public Int64 PolicyID { get; set; }

then it will work.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)