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

dotnet ef dbcontext scaffold does not use assembly name #6152

Closed
blackdwarf opened this issue Jul 24, 2016 · 8 comments
Closed

dotnet ef dbcontext scaffold does not use assembly name #6152

blackdwarf opened this issue Jul 24, 2016 · 8 comments

Comments

@blackdwarf
Copy link

Steps to reproduce

1- Create a asp.net web project.
2- Change the default namespace in the project properties to something different than the project name.
2- Set the project up to run ef dbcontext scaffold to create models from a SQL server db
3- Run the scaffolding command line

Expected behavior

Output classes use the Default namespace value for namespace names

Actual behavior

Output classes are using project name for namespace names

Environment data

Product Information:
Version: 1.0.0-preview1-002702
Commit Sha: 6cde21225e

Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64

Cross-post from dotnet/cli#3520

/cc @chassq

@rowanmiller
Copy link
Contributor

@natemcmaster @bricelam I think we already have this tracked somewhere right?

@natemcmaster
Copy link
Contributor

@rowanmiller "default namespace" is a Visual Studio-only feature and does not yet work in "dotnet ef" or .xproj projects. This will be fixed with #5334

@chassq can you clarify two things?

Run the scaffolding command line

Are you using Scaffold-DbContext or dotnet ef dbcontext scaffold?

Create a asp.net web project.

Which version of ASP.NET? ASP.NET Core or ASP.NET 4?

@rowanmiller
Copy link
Contributor

#4524 is the one I was thinking of. project.json has default namespaces - but we were going to wait until the project system consolidates before adding support.

@lajones
Copy link
Contributor

lajones commented Jul 25, 2016

See also #3988 - there the plans were to make the namespace be some combination of the default namespace for the project (or the project name if a default namespace isn't available) and what you specify for the --outputDir (provided --outputDir is within the project) and the schemas of the tables.

@natemcmaster
Copy link
Contributor

we were going to wait until the project system consolidates before adding support

I'll be tracking this in #6139

@chassq
Copy link

chassq commented Jul 25, 2016

dotnet ef dbcontext scaffold "Server=;Initial Catalog=;Persist Security Info=False;User ID=Password=;Pooling=False;Encrypt=True;TrustServerCertificate=False;" Microsoft.EntityFrameworkCore.SqlServer --output-dir models --force

ASP.NET Core using full .net framework 4.6.1

@chassq
Copy link

chassq commented Jul 25, 2016

Accounting for table schemas in ns would be awesome!

@rowanmiller
Copy link
Contributor

Tracked by #6139

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants