开发者

Weird linq-to-sql error

the error happens in this line:

OldPerson.PersonSerial = context.DB.Persons.Max(Function(p) p.PersonSerial) + 1

Could not find key member 'ID' of key 'ID' on type 'Nationality'. The key may be wrong or the field or property on 'Nationality' has changed names.

there's a person table containing a foreign key to the nationality table. i checked up that the 开发者_Python百科column names match

what might be the cause of this error?


looks like sharing a base class for partial linq generated classes is causing this issue.

i removed the inheritance from the base class and it worked. No idea why though!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜