SQLite NOT NULL constraint failed

EF DB first approach. During an insert the exception: "SQLite NOT NULL constraint failed (XX)" occurs. However, no exception will be thrown if I use the SqlClient provider against a MSSQL DB.

Table:

  • XY, PK, FK, int not null
  • XX, PK, int not null

Model-Configuration

        ToTable("Table");

        Property(on => on.XX)
            .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
            .HasColumnType(EntityFramework.IntDbType)
            .HasColumnName("XX")
            .IsRequired();
        HasKey(on => on.XX);

        Property(on => on.XY)
            .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None)
            .HasColumnType(EntityFramework.IntDbType)
            .HasColumnName("XY")
            .IsRequired();   

EDIT: XY is set in the model before .SaveChanges(); XX on the other hand is AI.