PostgreSQL Stored Procedure Name incorrect

Posts   
 
    
Jan VBM avatar
Jan VBM
User
Posts: 24
Joined: 03-Apr-2011
# Posted on: 08-Dec-2014 12:00:15   

Framework EFv6 LLBLGenPro 4.2 Final 2014-11-19 PostgreSQL 9.3 VS2013 C#

L.S., I'm using the above environment to make use of stored procedures in a Postgres database database lis, schema exprop,

CREATE OR REPLACE FUNCTION load_municipalities() RETURNS character varying

In the DbContext class code is generated as below, which does not compile

var cmd = CreateStoredProcCallCommand(""expro"."load_municipalities"");

which i can trace back to template contextClassInclude.lpt (folder LLBLGen Pro v4.2\Frameworks\Entity Framework\Templates\Shared\C#)

string storedProcedureToCall = SD_EF_GeneralUtils.ProduceTargetFullName(targetProc, _executingGenerator);

Any ideas on how to fix this?

tnx

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 08-Dec-2014 21:06:34   

Could you please attach a repro solution?

Jan VBM avatar
Jan VBM
User
Posts: 24
Joined: 03-Apr-2011
# Posted on: 09-Dec-2014 09:06:20   

see attached.

Npgsql version = 2.2.3

Selected preset = SD.EntityFramework.v6(Code First); Target Platform 4.5

Attached the generated code where PostgreSQL stored functions expro.load_municipalities() and public.load_temp_municipalities(varchar p_data_table)

are translated into GetLoadMunicipalitiesResults() and GetLoadTempMunicipalitiesResults(System.String pDataTable)

Attachments
Filename File size Added on Approval
Persistence - Copy.zip 9,614 09-Dec-2014 09:08.12 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 09-Dec-2014 11:58:03   

We'll look into it.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 09-Dec-2014 12:48:51   

The \" escaping gets lost during string building for the name. Will fix.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 09-Dec-2014 15:16:44   

Fixed. Copy the attached template into the following folder as administrator: <llblgen pro installation folder>\Frameworks\Entity Framework\Templates\Shared\C#

Attachments
Filename File size Added on Approval
contextClassInclude.lpt 35,225 09-Dec-2014 15:17.03 Approved
Frans Bouma | Lead developer LLBLGen Pro
Jan VBM avatar
Jan VBM
User
Posts: 24
Joined: 03-Apr-2011
# Posted on: 09-Dec-2014 15:35:02   

Thanks a lot, generated code is fine now.

        public DataTable GetLoadMunicipalitiesResults()
        {
            var cmd = CreateStoredProcCallCommand("\"expro\".\"load_municipalities\"");
            var toReturn = new DataTable();
            CreateAndSetupAdapter(cmd).Fill(toReturn);
            return toReturn;
        }