问题:
Want to improve this question? 想改善这个问题吗? Update the question so it focuses on one problem only by editing this post . 更新问题,使其仅通过编辑此帖子来关注一个问题。
Closed last year . 去年关闭。
I have a problem with Entity Framework in Asp.net. 我在Asp.net中遇到实体框架问题。 I want to get the Id value whenever I add an object to database. 每当将对象添加到数据库时,我都想获取Id值。 How can I do this? 我怎样才能做到这一点?
解决方案:
参考一: https://stackoom.com/question/Ls4d/如何在实体框架中获取插入实体的ID-关闭参考二: https://oldbug.net/q/Ls4d/How-can-I-get-Id-of-inserted-entity-in-Entity-framework-closed
来源:oschina
链接:https://my.oschina.net/u/4438370/blog/4407036