Skip to content

[EFCPT CLI] Stored Procedure model not generated with CLI #2908

@damien7792

Description

@damien7792

Bug description / exact reproduction steps

Hi,

I've been trying to generate models for tables and some stored procedures, but only models for tables are being created.

This is an extract from the json config file

"stored-procedures": [ { "name": "dbo.GetMyData" } ],

I ran FMTONLY for that stored procedure in SQL Management Studio, and it returned the columns of the result

But everytime I run it like this:

efcpt "data source=xxxx" mssql --input "xxx\efcpt-config.json" --verbose

It creates the models for the tables I have selected, but never the ones for the stored procedures.
Also, the "MyContextProcedures.cs" don't contain any reference to the stored procedure neither

The verbose logs don't show any warnings or errors.

What am I missing?
How can I fix this?

Thank you

Your code

{
  "$schema": "https://raw.githubusercontent.com/ErikEJ/EFCorePowerTools/master/samples/efcpt-config.schema.json",
  "tables": [
    {
      "name": "[dbo].[Supplier]"
    },
    {
      "name": "[dbo].[Client]"
    }
  ],
  "views": [
    {
      "exclusionWildcard": "*"
    }
  ],
  "stored-procedures": [
    {
      "name": "dbo.GetMyData"
    }
  ],
  "functions": [
    {
      "exclusionWildcard": "*"
    }
  ],
  "code-generation": {
    "enable-on-configuring": false,
    "type": "all",
    "use-database-names": false,
    "use-data-annotations": false,
    "use-nullable-reference-types": true,
    "use-inflector": false,
    "use-legacy-inflector": false,
    "use-many-to-many-entity": false,
    "use-t4": true,
    "remove-defaultsql-from-bool-properties": false,
    "soft-delete-obsolete-files": true,
    "discover-multiple-stored-procedure-resultsets-preview": false,
    "use-alternate-stored-procedure-resultset-discovery": false,
    "t4-template-path": null,
    "use-no-navigations-preview": false,
    "merge-dacpacs": false,
    "refresh-object-lists": false
  },
  "names": {
    "root-namespace": "MyProject",
    "dbcontext-name": "MyContext",
    "dbcontext-namespace": null,
    "model-namespace": null
  },
  "file-layout": {
    "output-path": "Models",
    "output-dbcontext-path": null,
    "split-dbcontext-preview": false,
    "use-schema-folders-preview": false,
    "use-schema-namespaces-preview": false
  },
  "type-mappings": {
    "use-DateOnly-TimeOnly": false,
    "use-HierarchyId": false,
    "use-spatial": false,
    "use-NodaTime": false
  },
  "replacements": {
    "preserve-casing-with-regex": false,
    "uncountable-words": [
      "Status",
      "Data"
    ]
  }
}

Stack traces


EF Core Power Tools version

No response

EF Core Power Tools CLI version

9.1.761

Database provider

MSSQL

Target framework

.NET 9.0

IDE

VS 2022 17.13.3

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