Skip to content

scaffolding doesn't generate any Entity classes, only DbContext #1998

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

Open
scastria opened this issue May 1, 2025 · 2 comments
Open

scaffolding doesn't generate any Entity classes, only DbContext #1998

scastria opened this issue May 1, 2025 · 2 comments

Comments

@scastria
Copy link

scastria commented May 1, 2025

dotnet 8
EF Core 8
Pomelo 8

I even tried adding Pomelo.EntityFrameworkCore.MySql.Design:

Image

If I use the MySql.EntityFrameCore package, I can scaffold just fine. However, if I try to use the Pomelo package, only the DbContext is created, but no Entity classes. There are no errors given. A verbose log does say, "No design-time services were found", but not sure that is a real error.

Using assembly 'Transformer'.
Using startup assembly 'Transformer'.
Using application base '/Users/shawncastrianni/GIT/transformer/container/source/Transformer/bin/Debug/net8.0'.
Using working directory '/Users/shawncastrianni/GIT/transformer/container/source/Transformer'.
Using root namespace 'Transformer'.
Using project directory '/Users/shawncastrianni/GIT/transformer/container/source/Transformer/'.
Remaining arguments: .
Finding design-time services referenced by assembly 'Transformer'...
Finding design-time services referenced by assembly 'Transformer'...
No referenced design-time services were found.
Finding design-time services for provider 'Pomelo.EntityFrameworkCore.MySql'...
Using design-time services from provider 'Pomelo.EntityFrameworkCore.MySql'.
Finding IDesignTimeServices implementations in assembly 'Transformer'...
No design-time services were found.
No explicit ServerVersion was set.
ServerVersion '8.0.39-mysql' was automatically detected.
Using ServerVersion '8.0.39-mysql'.
@scastria
Copy link
Author

scastria commented May 1, 2025

It looks like it has something to do with filtering. If I specify a database/schema in the connection string, then I can NOT use a schema prefix on my table filter.

connection string = "blah;blah;blah;database=wh_api"
dotnet ef dbcontext scaffold blah blah blah -t my_table

works.

However, the reverse is not true. if I omit the database portion of the connection string and prefix my table name with the schema, it does not work:

connection string = "blah;blah;blah"
dotnet ef dbcontext scaffold blah blah blah -t wh_api.my_table

does NOT work

@scastria
Copy link
Author

scastria commented May 7, 2025

Therefore, I do not know how to scaffold multiple schemas at one time. If I am forced to specify the schema in the connection string, then it will not be able to grab tables/views from other schemas. This seems like a bug.

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

1 participant