Skip to content

CLI generates wrong file name if the name of the class was overridden #3568

Description

@Powerz

When I change the name of the class in the interceptor, the CLI generates the correct class, but it puts it in a file with the wrong name (see example below).

public class SuperInterceptor : LinqToDB.Scaffold.ScaffoldInterceptors
{
    public override void PreprocessEntity(ITypeParser typeParser, EntityModel entityModel)
    {
        if (entityModel.Metadata.Name.ToString() == "dbo.SuperTable")
        {
            entityModel.Class.Name = "AwesomeTable";
            
            // The name of the file containing the generated class is going to be SuperTable instead of AwesomeTable
        }
    }
}

Expected file name: AwesomeTable.cs.
Actual file name: SuperTable.cs.

Environment details

linq2db version: 4.0.0
Database Server: Postgres
Operating system: macOS
.NET Framework: 6.0.101

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions