Entity framework core adds quotes to function name

1

I am using EF Core in my project and i want to use the property DbFunction. I declared my function like this :

[DbFunction]
    public static string int_to_str(int CODE)
    {
        throw new NotSupportedException();
    }

then I used this :

var list = _dbContext.Ccy
            .Select(c => new Ccy{ Code = DbContext.int_to_str(c.Code), Name = c.Name })
            .ToList();

but every time it adds automatically quotes to the name of the function and i get as putput

Microsoft.EntityFrameworkCore.Database.Command:Error: Failed executing DbCommand (12ms) [Parameters=[], CommandType='Text', CommandTimeout='0']
SELECT "int_to_str"("c".CODE) AS "Code", "c".LIBELLE AS "Name" FROM TABLE2 "c"
Devart.Data.Oracle.OracleException (0x80004005): ORA-00904: "int_to_str": invalid identifier

So it's obvious that the problem is the double quotes but I don't know why it adds them

c#
asp.net-core
.net-core
entity-framework-core
asked on Stack Overflow Jul 26, 2018 by Kais

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0