Skip to content

Name of class created to hold the data returned by stored procedure select statement doesn't follow the proper naming convention #3270

@boggye

Description

@boggye

Bug description / exact reproduction steps

Hello,

I have a stored procedure using this naming convention: dbo.some_name_sp. This stored procedures returns a resultset, in other words it contains a select statement.

When EFCpt generates the class that maps to the structures of the resultset, it uses the name: some_name_spResult.cs which doesn't match the normal convention I use. The name should have been SomeNameSpResult.cs.

This is what I have in the json config file:

  "code-generation": {
    "enable-on-configuring": false,
    "type": "all",
    "use-database-names": false,
    "use-data-annotations": true,
    "use-nullable-reference-types": true,
    "use-inflector": true,
    "use-legacy-inflector": false,
    "use-many-to-many-entity": false,
    "use-t4": false,
    "remove-defaultsql-from-bool-properties": false,
    "soft-delete-obsolete-files": false,
    "discover-multiple-stored-procedure-resultsets-preview": true,
    "use-alternate-stored-procedure-resultset-discovery": true,
    "t4-template-path": null,
    "use-no-navigations-preview": false,
    "merge-dacpacs": false,
    "refresh-object-lists": false
  },

I am reporting this as an issue because the table & view names are generated properly from all the table & view names that use the snake_case convention. It is possible that I missed a setting. I apologize if that is the case.

Thank you

Your code

Stored procedure to test:

SET ANSI_NULLS ON;
GO

SET QUOTED_IDENTIFIER ON;
GO

CREATE OR ALTER PROCEDURE dbo.some_name_sp 
AS
BEGIN
select 1 as field_name
end
go

Stack traces


EF Core Power Tools version

for .Net 8

EF Core Power Tools CLI version

8.1.1094

Provider:

The one for Sql Server 2017

Target framework

.Net 8

IDE

N/A - I use the command line CLI

Additional features in use

  • T4 templates
  • SQL Server .dacpac
  • Handlebars template

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions