-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Describe the bug
Model classes are not recognized when EnableSchemaFolder is enabled. This occures when a constraint is configured on the database between tables in different schemas.
The namespaces for references tables in different schemas are missing:
There is also an issues on the context:

To Reproduce
I used the sample project from the git repo and created the northwind database with the provided SQL script.
In sql management studio I created a new schema called "app" and created a table TestTable (see screenshot).
Finally I linked the app.TestTable and dbo.Employee tables.
Make My Life Easier
I didn't change any code on the sample app - so no PR provided. ;-)
EDIT: To make your life easier, I wrote the SQL script to create the schema, table and relation:
USE [NorthwindSlim]
GO
CREATE SCHEMA App;
GO
CREATE TABLE App.TestTable
(
Id int NOT NULL IDENTITY (1, 1),
Name nvarchar(50) NOT NULL,
EmployeeId int NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE App.TestTable ADD CONSTRAINT
PK_TestTable PRIMARY KEY CLUSTERED
(
Id
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE App.TestTable ADD CONSTRAINT
FK_TestTable_Employee FOREIGN KEY
(
EmployeeId
) REFERENCES dbo.Employee
(
EmployeeId
) ON UPDATE CASCADE
ON DELETE CASCADE

