How to get the Primary Key(s) in Entity Framework 4.1, i.e. using DbContext

后端 未结 5 1914
逝去的感伤
逝去的感伤 2020-12-29 08:52

The answers I\'m seeing here are for ObjectContext. Is there a property to determine an entity\'s primary key names when using DbContext?

Ah.. one of those times tha

5条回答
  •  悲哀的现实
    2020-12-29 09:47

    you can get to ObjectContext because DbContext mostly wraps ObjectContext...

    see
    http://msdn.microsoft.com/en-us/library/gg696590%28v=vs.103%29.aspx
    http://msdn.microsoft.com/en-us/library/system.data.entity.dbcontext%28v=vs.103%29.aspx
    http://msdn.microsoft.com/en-us/library/dd283139.aspx

提交回复
热议问题