You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting .NET 6 (dotnet-ef 6.0.0) I can no longer reverse engineer our company database.
Seems to be because of ambiguity of foreign key column names. No problem in dotnet-ef 5.x.
The property or navigation 'Groups' cannot be added to the entity type 'SomeTable (Dictionary<string, object>)' because a property or navigation with the same name already exists on entity type 'SomeTable (Dictionary<string, object>)'.
CREATE DATABASE EfTest
GO
USE EfTest
GO
CREATE TABLE GroupTable1
(
GroupId INT NOT NULL,
Name NVARCHAR(100) NOT NULL
PRIMARY KEY (GroupId)
)
CREATE TABLE GroupTable2
(
GroupId INT NOT NULL,
Name NVARCHAR(100) NOT NULL
PRIMARY KEY (GroupId)
)
CREATE TABLE SomeTable
(
SomeId INT NOT NULL,
Name NVARCHAR(100) NOT NULL,
PRIMARY KEY (SomeId)
)
CREATE TABLE SomeJoinTable1
(
SomeId INT NOT NULL,
GroupId INT NOT NULL,
PRIMARY KEY (SomeId, GroupId),
FOREIGN KEY (SomeId) REFERENCES SomeTable (SomeId),
FOREIGN KEY (GroupId) REFERENCES GroupTable1 (GroupId)
)
CREATE TABLE SomeJoinTable2
(
SomeId INT NOT NULL,
GroupId INT NOT NULL,
PRIMARY KEY (SomeId, GroupId),
FOREIGN KEY (SomeId) REFERENCES SomeTable (SomeId),
FOREIGN KEY (GroupId) REFERENCES GroupTable2 (GroupId)
)
The text was updated successfully, but these errors were encountered:
Starting .NET 6 (dotnet-ef 6.0.0) I can no longer reverse engineer our company database.
Seems to be because of ambiguity of foreign key column names. No problem in dotnet-ef 5.x.
The property or navigation 'Groups' cannot be added to the entity type 'SomeTable (Dictionary<string, object>)' because a property or navigation with the same name already exists on entity type 'SomeTable (Dictionary<string, object>)'.
Reproduced it with a small test database.
--
The text was updated successfully, but these errors were encountered: