I am using Entity Framework 5 code-first and I have overridden the SaveChanges method. In SaveChanges, I want to identify any entities with an EntityState == EntityState.Added (I can do this easily enough) however I then want to identify any columns in those entities which have been defined as a primary key, have their HasDatabaseGeneratedOption property set to DatabaseGeneratedOption.None and currently have Null value.
I need to identify these columns as my database currently has some columns defined as primary keys which need to be manually populated via code. I figured I could tackle this population of columns in SaveChanges on an insert but am stumped as to how to identify them.
How do I query column definitions in SaveChanges? I obviously know how to examine the data value