Entity Type Has No Key Defined

后端 未结 4 1401
走了就别回头了
走了就别回头了 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:53

    I ran into this post after facing a similar issue today. The problem was that I was attempting to create the scaffold after adding the [Key] attribute to my model and without compiling. Once I compiled with the [Key] attribute the scaffolding generated just fine.

提交回复
热议问题