add-migration 遇到 The foreign key property 'Article.ArticleTypeId1' was created in shadow state 問題
環境: asp.net core MVC 搭配 sql server 2014
使用 entity framework core code first
下 add-migration 指令時,發現奇怪的訊息
The foreign key property 'Article.ArticleTypeId1' was created in shadow state because a conflicting property with the simple name 'ArticleTypeId' exists in the entity type, but is either not mapped, is already used for another relationship, or is incompatible with the associated primary key type. See https://aka.ms/efcore-relationships for information on mapping relationships in EF Core.
文章是 Article.cs
Article.cs 裡面有一個 ArticleTypeId 欄位用來記錄文章的分類
留言
張貼留言