Skip to content

Scaffold-DbContext can name namespace wrong if phrase with space is used on OutputDir #24607

Open

Description

Scaffold-DbContext is naming namespace wrong if -OutputDir is filled with phrase containing space.

For example: Example Folder OutputDir makes namespace ConsoleApp.Example Folder, what is wrong for naming namespaces and can't be builded. It should be ConsoleApp.Example_Folder.

Code

I made command through PMC like this:

Scaffold-DbContext "connectionString" MySql.EntityFrameworkCore -Tables some_tables_here -OutputDir "Example Folder" -Force

Command is working, but output classes and context have wrong namespace.

Include provider and version information

EF Core version: 5.0
Database provider: MySql.EntityFrameworkCore
Target framework: NET 5.0
Operating system:
IDE: Visual Studio 2019 16.9.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions