Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

EF Core Scaffold-DbContext table not included in the selection set

$
0
0

I recently upgraded to .Net Core 2.0, and I'm running into a lot of issues scaffolding an existing database.

First of all, when I run

Scaffold-DbContext"Server=mysrv;Database=mydb;User Id=uname;password=pword"Microsoft.EntityFrameworkCore.SqlServer-OutputDirModels

I get the following errors. Which are really confusing me because there is no table in my database with a UK_principal_name index..

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.

So I tried specifying a table I want from the database like this.

Scaffold-DbContext"Server=mysrv;Database=mydb;User Id=uname;password=pword"Microsoft.EntityFrameworkCore.SqlServer-OutputDirModels-TableBurner

And I get the errors I had before along with this error.

Index column dbo.BurnerHistory belongs to index PK_BurnerHistory on table Burn_Hist_Idx which isnot included in the selection set.Skipping.

What does it mean when it says the table is not included in the selection set? On the previous version of .NET Core I had no problem running this scaffold command, it would grab all of my tables and generate code for them in the model.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>