最近、.Net Core 2.0にアップグレードしましたが、既存のデータベースを足場にして多くの問題を抱えています。すべてのEF Core Scaffold-DbContextテーブルが選択セットに含まれていません
まず、私は次のエラーを取得
Scaffold-DbContext "Server=mysrv;Database=mydb;User Id=uname;password=pword" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
を実行します。私のデータベースにUK_principal_nameインデックスを持つテーブルがないので、本当に混乱しますか?
Unable to find a table in the database matching the selected table dbo.sysdiagrams.
For index PK__sysdiagrams__0CBAE877. Unable to find parent table dbo.sysdiagrams. Skipping index.
For index UK_principal_name. Unable to find parent table dbo.sysdiagrams. Skipping index.
私はこのようなデータベースから必要なテーブルを指定しようとしました。
Scaffold-DbContext "Server=mysrv;Database=mydb;User Id=uname;password=pword" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Table Burner
このエラーと一緒に私が以前に持っていたエラーを取得します。
Index column dbo.BurnerHistory belongs to index PK_BurnerHistory on table Burn_Hist_Idx which is not included in the selection set. Skipping.
表が選択セットに含まれていないとはどういう意味ですか? .NET Coreの以前のバージョンでは、このscaffoldコマンドの実行に問題はなく、すべてのテーブルを取得し、モデル内でコードを生成しました。
私はそれが警告で、エラーではないと思います – ErikEJ