EF Generic Repository get Id from new inserted generic entity

后端 未结 4 1060
感动是毒
感动是毒 2020-12-19 03:30

All my entities has property Id. All my tables in database has auto-generated integer identity Id as primary key.

I have generic method to Create entities.

I

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-19 04:32

    With POCO entities, you'd have to use an interface, reflection, or dynamic.

    With EntityObject entities you can read the EntityKey property.

提交回复
热议问题