问题
I'm trying to scaffold from an existing database but the database has multiple tables with multiple schemas and some tables have the same names but within different schemas and i "think" this is the source of my problem and I was wondering if you've faced a similar scenario?
For example mySchema1.contacts
and mySchema2.contacts
in the same database.
Here is my command:
dotnet ef dbcontext scaffold "Data Source=database;Initial Catalog=table;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" Microsoft.EntityFrameworkCore.SqlServer --schema mySchema1, -t contacts -o Models
Here is my error:
Error Number:209,State:1,Class:16 Ambiguous column name 'name'.
来源:https://stackoverflow.com/questions/51103149/ambiguous-column-name-name-error-when-scaffolding-dbcontext