Обсуждение: Function not imported in Entity Framework
Dear sir/mam,
I want to integrate PostgreSQL database to entity framework in asp.net using database first approach. but when try to add function then error occurred:
Error 6046: Unable to generate function import return type of the store function.
I have following configuration:
PostgreSQL 11.6,
npgsql v.4.0.9.0,
EntityFramework6.Npgsql 3.2.1.1,
in .net framework 4.5.2
My function in postgresql database is :
CREATE OR REPLACE FUNCTION dbo.EmployeeDetail ()
RETURNS TABLE (
emp_name VARCHAR,
emp_Id UUID
)
AS $$
BEGIN
RETURN QUERY SELECT
"EmployeName",
"EmployeeID"
FROM
dbo.Employee;
END; $$
LANGUAGE 'plpgsql';
Can you pls help! I did more researches but no luck.
Thanks!
On 2/6/20 1:36 AM, Vikram Sah wrote: > Dear sir/mam, > > I want to integrate PostgreSQL database to entity framework in asp.net > <http://asp.net> using database first approach. but when try to add > function then error occurred: > > *Error 6046: Unable to generate function import return type of the store > function.* This really a question for the EntityFramework maintainers/users. Still I did find this: https://stackoverflow.com/questions/24161005/error-6046-unable-to-generate-function-import-return-type-of-the-store-function > > I have following configuration: > > PostgreSQL 11.6, > npgsql v.4.0.9.0, > EntityFramework6.Npgsql 3.2.1.1, > in .net framework 4.5.2 > > *My function in postgresql database is :* > > CREATE OR REPLACE FUNCTION dbo.EmployeeDetail () > RETURNS TABLE ( > emp_name VARCHAR, > emp_Id UUID > ) > AS $$ > BEGIN > RETURN QUERY SELECT > "EmployeName", > "EmployeeID" > FROM > dbo.Employee; > END; $$ > > LANGUAGE 'plpgsql'; > > > Can you pls help! I did more researches but no luck. > > > Thanks! > > > -- Adrian Klaver adrian.klaver@aklaver.com
On 2/6/20 1:36 AM, Vikram Sah wrote:
> Dear sir/mam,
>
> I want to integrate PostgreSQL database to entity framework in asp.net
> <http://asp.net> using database first approach. but when try to add
> function then error occurred:
>
> *Error 6046: Unable to generate function import return type of the store
> function.*
This really a question for the EntityFramework maintainers/users. Still
I did find this:
https://stackoverflow.com/questions/24161005/error-6046-unable-to-generate-function-import-return-type-of-the-store-function
>
> I have following configuration:
>
> PostgreSQL 11.6,
> npgsql v.4.0.9.0,
> EntityFramework6.Npgsql 3.2.1.1,
> in .net framework 4.5.2
>
> *My function in postgresql database is :*
>
> CREATE OR REPLACE FUNCTION dbo.EmployeeDetail ()
> RETURNS TABLE (
> emp_name VARCHAR,
> emp_Id UUID
> )
> AS $$
> BEGIN
> RETURN QUERY SELECT
> "EmployeName",
> "EmployeeID"
> FROM
> dbo.Employee;
> END; $$
>
> LANGUAGE 'plpgsql';
>
>
> Can you pls help! I did more researches but no luck.
>
>
> Thanks!
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
On 2/11/20 3:56 AM, Vikram Sah wrote: > Thank you so much sir, but it didn't work for me as the database > function in PostgreSQL and EntityFramework6.Npgsql is used as provider > for entity framework. I have no idea where to go from here. Your best bet would be to reach out to the EntityFramework6.Npgsql community > > Thanks! > Vikram > -- Adrian Klaver adrian.klaver@aklaver.com
On 2/11/20 3:56 AM, Vikram Sah wrote:
> Thank you so much sir, but it didn't work for me as the database
> function in PostgreSQL and EntityFramework6.Npgsql is used as provider
> for entity framework.
I have no idea where to go from here. Your best bet would be to reach
out to the EntityFramework6.Npgsql community
>
> Thanks!
> Vikram
>
--
Adrian Klaver
adrian.klaver@aklaver.com
On 2/11/20 8:35 AM, Vikram Sah wrote: > Got it sir, but unfortunately they have not provided any solution for > the last 5 days. Where have you asked besides here? > > Thanks > > On Tue, 11 Feb 2020, 10:12 pm Adrian Klaver, <adrian.klaver@aklaver.com > <mailto:adrian.klaver@aklaver.com>> wrote: > > On 2/11/20 3:56 AM, Vikram Sah wrote: > > Thank you so much sir, but it didn't work for me as the database > > function in PostgreSQL and EntityFramework6.Npgsql is used as > provider > > for entity framework. > > I have no idea where to go from here. Your best bet would be to reach > out to the EntityFramework6.Npgsql community > > > > > Thanks! > > Vikram > > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com> > -- Adrian Klaver adrian.klaver@aklaver.com
On 2/11/20 8:35 AM, Vikram Sah wrote:
> Got it sir, but unfortunately they have not provided any solution for
> the last 5 days.
Where have you asked besides here?
>
> Thanks
>
> On Tue, 11 Feb 2020, 10:12 pm Adrian Klaver, <adrian.klaver@aklaver.com
> <mailto:adrian.klaver@aklaver.com>> wrote:
>
> On 2/11/20 3:56 AM, Vikram Sah wrote:
> > Thank you so much sir, but it didn't work for me as the database
> > function in PostgreSQL and EntityFramework6.Npgsql is used as
> provider
> > for entity framework.
>
> I have no idea where to go from here. Your best bet would be to reach
> out to the EntityFramework6.Npgsql community
>
> >
> > Thanks!
> > Vikram
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Вложения
Thanks for highlighting this issue.
I have tested this using .net 4.8 and Core 3.1 against Sql Server, they all exhibit the same problem.
The best course of action is probably to identify a workaround, based on your project, until Microsoft team have the time to fix the issue.
It would be good idea to report this to Microsoft.
From: Vikram Sah <rblucky3@gmail.com>
Sent: 2020 February 12 01:18
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Function not imported in Entity Framework
Sir,
I asked this in npgsql community who have developed "EntityFramework6.Npgsql" , link is :
https://github.com/npgsql/npgsql/issues/948. and developer named Shay Rojansky aka roji has replied as below image:
On Tue, Feb 11, 2020 at 10:30 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 2/11/20 8:35 AM, Vikram Sah wrote:
> Got it sir, but unfortunately they have not provided any solution for
> the last 5 days.
Where have you asked besides here?
>
> Thanks
>
> On Tue, 11 Feb 2020, 10:12 pm Adrian Klaver, <adrian.klaver@aklaver.com
> <mailto:adrian.klaver@aklaver.com>> wrote:
>
> On 2/11/20 3:56 AM, Vikram Sah wrote:
> > Thank you so much sir, but it didn't work for me as the database
> > function in PostgreSQL and EntityFramework6.Npgsql is used as
> provider
> > for entity framework.
>
> I have no idea where to go from here. Your best bet would be to reach
> out to the EntityFramework6.Npgsql community
>
> >
> > Thanks!
> > Vikram
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Thanks for highlighting this issue.
I have tested this using .net 4.8 and Core 3.1 against Sql Server, they all exhibit the same problem.
The best course of action is probably to identify a workaround, based on your project, until Microsoft team have the time to fix the issue.
It would be good idea to report this to Microsoft.
From: Vikram Sah <rblucky3@gmail.com>
Sent: 2020 February 12 01:18
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Function not imported in Entity Framework
Sir,
I asked this in npgsql community who have developed "EntityFramework6.Npgsql" , link is :
https://github.com/npgsql/npgsql/issues/948. and developer named Shay Rojansky aka roji has replied as below image:
On Tue, Feb 11, 2020 at 10:30 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 2/11/20 8:35 AM, Vikram Sah wrote:
> Got it sir, but unfortunately they have not provided any solution for
> the last 5 days.
Where have you asked besides here?
>
> Thanks
>
> On Tue, 11 Feb 2020, 10:12 pm Adrian Klaver, <adrian.klaver@aklaver.com
> <mailto:adrian.klaver@aklaver.com>> wrote:
>
> On 2/11/20 3:56 AM, Vikram Sah wrote:
> > Thank you so much sir, but it didn't work for me as the database
> > function in PostgreSQL and EntityFramework6.Npgsql is used as
> provider
> > for entity framework.
>
> I have no idea where to go from here. Your best bet would be to reach
> out to the EntityFramework6.Npgsql community
>
> >
> > Thanks!
> > Vikram
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
--
Adrian Klaver
adrian.klaver@aklaver.com