How to automatically generate identity for an Oracle database through Entity framework?

前端 未结 5 1735
自闭症患者
自闭症患者 2020-12-15 08:50

I\'m using Oracle provider for Entity framework (beta), and I\'m facing a problem.

Our tables have Id columns, which are set to be Identity in StoreGeneratedPattern.

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 09:14

    I am using Oracle ODP.NET, Managed driver and Entity Framework 6. I created my tables using the code-first approach but wasn't able to add any records due to a null primary key.

    The solution was to grant my user both:
    'CREATE SEQUENCE' and
    'CREATE TRIGGER'
    permissions and re-create the schema.

    I realized this after using the -verbose flag in the package management console

提交回复
热议问题