C#, entity framework, auto increment

前端 未结 5 1268
粉色の甜心
粉色の甜心 2020-12-02 23:07

I\'m learning Entity Framework under VC# 2010.

I have created a simple table for learning purposes, one of the fields is \"id\" type integer, identity set to true. I

5条回答
  •  清歌不尽
    2020-12-02 23:56

    Check in your EDMX model, that the autoincrement field's StoreGeneratedPattern attribute is set to "Identity". In this way, EF knows that the autonumbers are handled by the DB.

    Here this is explained better: Autonumber with Entity Framework

提交回复
热议问题