Skip to content

Pascal-case the DbContext name when scaffolding #27886

@vanillajonathan

Description

@vanillajonathan

When scaffolding from a SQLite database using the dotnet ef tool it will create the DbContext with the initial lowercase if the database filename is lowercase.

Example:

dotnet ef dbcontext scaffold "DataSource=blogging.db;Cache=Shared" Microsoft.EntityFrameworkCore.Sqlite

It creates the DbContext with the filename bloggingContext.cs and the class name bloggingContext which is rather ugly.

Running dotnet ef dbcontext scaffold --help it states:

-c|--context <NAME>                    The name of the DbContext. Defaults to the database name.

But my expectation was that it would still create the filename and the class name with the initial letter uppercase as is the .NET convention.

EF Core version: 6.0.4
Database provider: (e.g. Microsoft.EntityFrameworkCore.Sqlite)
Target framework: (e.g. .NET 6.0)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions