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
Describe the bug
Imports are wrongly generated (e.g. using masters = .masters) in context file when EnableSchemaFolders = true in options but either namespace is not provided or its same for context and model.
Expected behavior
It should generate namespace as using <schema> = <modelNamespace>.<schema>
or using <modelNamespace>.<schema>
Make My Life Easier
This seems to be happening due to this condition , which is not assigning value to _modelNamespace when both namespace are same
File: HbsCSharpDbContextGenerator.cs
Method: WriteCode(..)
if (!string.IsNullOrEmpty(modelNamespace) && string.CompareOrdinal(contextNamespace, modelNamespace) != 0)
_modelNamespace = modelNamespace;
The text was updated successfully, but these errors were encountered:
Describe the bug
Imports are wrongly generated (e.g.
using masters = .masters
) in context file when EnableSchemaFolders = true in options but either namespace is not provided or its same for context and model.Expected behavior
It should generate namespace as
using <schema> = <modelNamespace>.<schema>
or
using <modelNamespace>.<schema>
To Reproduce
Using PostgreSQL with
Scaffold-DbContext Name=<connection string> Npgsql.EntityFrameworkCore.PostgreSQL -Namespace SomeAPI.DbModels -ContextNamespace SomeAPI.DbModels -o DbModels
or
Scaffold-DbContext Name=<connection string> Npgsql.EntityFrameworkCore.PostgreSQL -o DbModels
Make My Life Easier
This seems to be happening due to this condition , which is not assigning value to _modelNamespace when both namespace are same
File: HbsCSharpDbContextGenerator.cs
Method: WriteCode(..)
The text was updated successfully, but these errors were encountered: