Entity Type Has No Key Defined

后端 未结 4 1387
走了就别回头了
走了就别回头了 2021-02-19 08:00

Another \'Entity Type \'x\' has no key defined\' question, but I\'ve set the [Key] attribute on a property so I\'m a bit confused.

Here\'s my entity and con

4条回答
  •  情深已故
    2021-02-19 08:42

    To help clarify, this line:

    public string GMCNumber;

    needs to become:

    public string GMCNumber { get; set; }

提交回复
热议问题