'Identity_insert off in Entity Framework

I am using Entity Framework for CRUD operations. When I tried to insert data in a table which has an identity column, it throws an exception

Identity_Insert is set to off

I don't know how to turn that on. Do I need to reconfigure entity data model for that?



Solution 1:[1]

Sounds like the EF is including an explicit value for the PK in the INSERT. It should not do this. Make sure StoreGeneratedPattern is set to identity on the PK in the SSDL. This article might help.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Craig Stuntz