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

Wrong model-namespace using in generated context #25473

Closed
SchroeerM opened this issue Aug 10, 2021 · 2 comments
Closed

Wrong model-namespace using in generated context #25473

SchroeerM opened this issue Aug 10, 2021 · 2 comments
Assignees
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. customer-reported punted-for-6.0 punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints.

Comments

@SchroeerM
Copy link

Hello,

if I try to scaffold an empty database to control it later by ef-versioning the generated context contains an using for the models-namespace. If the database is empty this namespace is empty as well and the compilation throws an error.

Steps to reproduce:

  1. create an empty database
  2. use "dotnet ef database scaffold" in an project
  3. try to compile the generated code.

Ive fixed this on my site but an general fix should prevent the first error-message which appears directly after executing the scaffold command.

Thanks,
Michael

@ajcvickers ajcvickers added this to the 6.0.0 milestone Aug 10, 2021
@AndriySvyryd AndriySvyryd modified the milestones: 6.0.0, Backlog Sep 15, 2021
@ajcvickers ajcvickers modified the milestones: Backlog, 7.0.0 Nov 10, 2021
@ajcvickers ajcvickers added propose-punt punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. and removed propose-punt labels Jul 6, 2022
@ajcvickers ajcvickers modified the milestones: 7.0.0, Backlog Jul 7, 2022
bricelam added a commit to bricelam/efcore that referenced this issue Jul 29, 2022
This refactors our existing scaffolding code into T4 templates that we can both precompile to use as our default code generator and also ship somehow (probably `dotnet new`) as a starting point for users to start customizing.

Part of dotnet#4038, part of dotnet#14545, fixes dotnet#25473, resolves dotnet#25546, resolves dotnet#25547, fixes dotnet#27087, part of dotnet#27588, fixes dotnet#28187
@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 29, 2022
@bricelam bricelam modified the milestones: Backlog, 7.0.0 Jul 29, 2022
bricelam added a commit to bricelam/efcore that referenced this issue Aug 1, 2022
This refactors our existing scaffolding code into T4 templates that we can both precompile to use as our default code generator and also ship somehow (probably `dotnet new`) as a starting point for users to start customizing.

Part of dotnet#4038, part of dotnet#14545, fixes dotnet#25473, resolves dotnet#25546, resolves dotnet#25547, fixes dotnet#27087, part of dotnet#27588, fixes dotnet#28187
@bricelam
Copy link
Contributor

bricelam commented Aug 4, 2022

As far as I can tell, you need to meet both of the following conditions to hit this.

  1. Have a database with no views or tables
  2. Specify a --context-namespace that's different from the entity types' --namespace

If this isn't the case, can you share more details?

@bricelam bricelam removed the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 4, 2022
@bricelam bricelam removed this from the 7.0.0 milestone Aug 4, 2022
bricelam added a commit to bricelam/efcore that referenced this issue Aug 8, 2022
This refactors our existing scaffolding code into T4 templates that we can both precompile to use as our default code generator and also ship somehow (probably `dotnet new`) as a starting point for users to start customizing.

Part of dotnet#4038, part of dotnet#14545, fixes dotnet#25473, resolves dotnet#25546, resolves dotnet#25547, fixes dotnet#27087, part of dotnet#27588, fixes dotnet#28187
@bricelam bricelam reopened this Aug 9, 2022
@ajcvickers
Copy link
Contributor

Note from triage: this very much a corner case. With the introduction of templates in EF7, this can be handled by editing the template if desired.

@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Aug 11, 2022
@ajcvickers ajcvickers added closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. and removed type-bug poachable area-scaffolding labels Aug 11, 2022
@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
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. customer-reported punted-for-6.0 punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints.
Projects
None yet
Development

No branches or pull requests

4 participants