【发布时间】:2020-06-16 12:49:17
【问题描述】:
不知道为什么我会得到这个错误,即使我在键列上有“键”属性。类看起来像这样:
public class MyClass
{
[Key]
private string MyPrimaryKey { get; set; }
...
}
【问题讨论】:
-
你必须将
MyPrimaryKey定义为public -
啊,当然,谢谢