Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaffolded models are created with "_" instead of "." separator #9787

Closed
sam-wheat opened this issue Sep 12, 2017 · 4 comments
Closed

Scaffolded models are created with "_" instead of "." separator #9787

sam-wheat opened this issue Sep 12, 2017 · 4 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@sam-wheat
Copy link

ef core 2.0

Possibly related

This command

Scaffold-DbContext "Server=yada;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Connect.Model

resulted in models with namespaces like this:

namespace Domain.Connect_Model

Expected:

namespace Domain.Connect.Model
@smitpatel
Copy link
Member

This is one of the observations I made during #9723
This is one of the cases where Migrations & RevEng are differing.

RevEng is trying to csharp-ify the output path before making namespace.
output dir arg
a.b.c => a_b_c
a\b\c => a.b.c

@sam-wheat
Copy link
Author

@smitpatel Oh wow... this seems very convoluted.
Hopefully my comment here: 9786 will be considered. Seems like it would solve a number of issues if we could just scaffold from the project/directory where we want our models to live.

@sam-wheat
Copy link
Author

BTW in my case "X.Y" is both a valid directory name and .net namespace.

@smitpatel
Copy link
Member

"X.Y" is valid .net namespace but not valid c# identifier (you cannot name a class like that). It shouldn't have mattered but that is wrong assumption reveng tool did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

3 participants