1

I would like all stored procedures generated from the model to have the name prefixed with "cf_". I added procedureFormat="cf_{0}" to the project element. However, it did not work. Is there something else I'm missing?

Below is the project element:

<cf:project defaultNamespace="DemoNaming" xmlns:cf="http://www.softfluent.com/codefluent/2005/1" xmlns:cfx="http://www.softfluent.com/codefluent/modeler/2008/1" xmlns:cfps="http://www.softfluent.com/codefluent/producers.sqlserver/2005/1" xmlns:cfom="http://www.softfluent.com/codefluent/producers.model/2005/1" xmlns:cfasp="http://www.softfluent.com/codefluent/producers.aspnet/2011/1" defaultConnectionString="Database=DemoNaming;Server=.\DEV_SQL_1;Integrated Security=true" createDefaultMethodForms="true" createDefaultApplication="false" createDefaultHints="false" procedureFormat="cf_{0}">
Dave
  • 649
  • 5
  • 13

2 Answers2

1

You forgot to define the naming convention to use, so CodeFluent Entities uses the BaseNamingConvention. From the documentation, you must set the namingConventionTypeName attribute to CodeFluent.Model.Naming.FormatNamingConvention, CodeFluent.Model:

FormatNamingConvention derives from the BaseNamingConvention class and adds format capabilities and is used as the base class to all other out-of-the-box naming conventions.

<cf:project
    namingConventionTypeName="CodeFluent.Model.Naming.FormatNamingConvention, CodeFluent.Model"
    procedureFormat="cf_{0}">
    (...)
 </cf:project>
meziantou
  • 20,589
  • 7
  • 64
  • 83
0

BONUS CODE - Changing the naming convention does not delete the old stored procedures, which is probably a good thing. The following query will create a drop statement for each of the old stored procedures. To use, run it in SQL Management Studio, click the column from the result tab and copy to clipboard. Then paste in a new query window.

SELECT 'DROP PROCEDURE [' + r1.ROUTINE_SCHEMA + '].[' + r1.ROUTINE_NAME + ']'
FROM  INFORMATION_SCHEMA.ROUTINES r1
INNER JOIN INFORMATION_SCHEMA.ROUTINES r2 ON r2.ROUTINE_SCHEMA = r1.ROUTINE_SCHEMA AND r2.ROUTINE_NAME = 'cf_' + r1.ROUTINE_NAME
Dave
  • 649
  • 5
  • 13