#StackBounty: #.net #oracle #entity-framework #ado.net Entity Framework 6 – StoreGeneratedPattern value not staying

Bounty: 50

We are using Entity Framework 6.2.0 against an Oracle 12c database, and have been following the Database-First approach.

A lot of out tables have an _ID column that is generated by the database upon INSERT. This is down by using a default value on the DB server, TABLE_SEQUENCE.NEXTVAL.

After generating the DB model in Entity Framework, I went through and marked each _ID column as StoreGeneratedPattern="Identity" and we were all set to go. However, when updating the DB model after some DB changes, we noticed an issue. One table in particular forgets this setting and resets this back to None. All other tables remember StoreGeneratedPattern="Identity".

This consistently happens each time we update the DB model from the database.
Visual Studio will still say that PROBLEMATIC_TABLE_ID has Identity set, but the .edmx file does not.
My process has been to update the model, then open the .edmx file and manually paste in StoreGeneratedPattern="Identity" for that one column.

I have compared this table against others in the DB, in the .edmx, in the codebase, and I cannot find anything that would cause this one column on this one table to behave differently upon DB model update.

TL;DR: Upon updating our local DB model from the database, the value for StoreGeneratedPattern on one column/table is always reset, while all others stay the same. VS still says it is Identity, but the XML in the .edmx file disagrees and needs to be updated manually.

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.