Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Entity Framwork generated model for stored procedure [DNET378] #383

Closed
firebird-automations opened this issue Apr 27, 2011 · 5 comments

Comments

@firebird-automations
Copy link

Submitted by: Doru Constantin (doru_constantin)

I've generated the edmx model an work with data.All fine.
Now I try to run a simple stored procedure. My SP takes no parameters, but when I try to call it VS2010 IntelliSense say that I have to provide one parameter of type ObjectParameter

This is the generated model for stored procedure:

    public ObjectResult<global::System\.String\> sp\_Tables\(ObjectParameter tABLE\_NAME\)
    \{
        return base\.ExecuteFunction<global::System\.String\>\("sp\_Tables", tABLE\_NAME\);
    \}

and this is the stored preocedure DDL:

CREATE OR ALTER PROCEDURE SP_TABLES
RETURNS(
table_name char(31))
AS
BEGIN
FOR SELECT RDB$RELATION_NAME
FROM RDB$RELATIONS
WHERE (LEFT(RDB$RELATION_NAME, 4) NOT IN('RDB$', 'MON$')) AND (RDB$VIEW_SOURCE IS NULL)
INTO :TABLE_NAME
DO SUSPEND;
END

I can modify the code like this (and it works fine):

    public ObjectResult<global::System\.String\> sp\_Tables\(\)
    \{
        return base\.ExecuteFunction<global::System\.String\>\("sp\_Tables"\);
    \}

but it gets overwritten every time I upate the entity model.

I think (by comparing with model generated for SQL Server Express) that edmx file is generated Ok. The problem is in .cs associated file.

Thank you for your time.

Doru

@firebird-automations
Copy link
Author

Modified by: Doru Constantin (doru_constantin)

description: I use VS2010 Pro with http://FirebirdSQL.NET provider 2.6 + C#⁠ 4.0 on FirebirdSQL Server 2.5.1.26237.
I've generated the edmx model an work with data.All fine.
Now I try to run a simple stored procedure. My SP takes no parameters, but when I try to call it VS2010 IntelliSense say that I have to provide one parameter of type ObjectParameter

This is the generated model for stored procedure:

    public ObjectResult<global::System\.String\> sp\_Tables\(ObjectParameter tABLE\_NAME\)
    \{
        return base\.ExecuteFunction<global::System\.String\>\("sp\_Tables", tABLE\_NAME\);
    \}

and this is the stored preocedure DDL:

CREATE OR ALTER PROCEDURE SP_TABLES
RETURNS(
table_name char(31))
AS
BEGIN
FOR SELECT RDB$RELATION_NAME
FROM RDB$RELATIONS
WHERE (LEFT(RDB$RELATION_NAME, 4) NOT IN('RDB$', 'MON$')) AND (RDB$VIEW_SOURCE IS NULL)
INTO :TABLE_NAME
DO SUSPEND;
END

I can modify the code like this (and it works fine):

    public ObjectResult<global::System\.String\> sp\_Tables\(\)
    \{
        return base\.ExecuteFunction<global::System\.String\>\("sp\_Tables"\);
    \}

but it gets overwritten every time I upate the entity model.

I think (by comparing with model generated for SQL Server Express) that edmx file is generated Ok. The problem is in .cs associated file.

Thank you for your time.

Doru

=>

I've generated the edmx model an work with data.All fine.
Now I try to run a simple stored procedure. My SP takes no parameters, but when I try to call it VS2010 IntelliSense say that I have to provide one parameter of type ObjectParameter

This is the generated model for stored procedure:

    public ObjectResult<global::System\.String\> sp\_Tables\(ObjectParameter tABLE\_NAME\)
    \{
        return base\.ExecuteFunction<global::System\.String\>\("sp\_Tables", tABLE\_NAME\);
    \}

and this is the stored preocedure DDL:

CREATE OR ALTER PROCEDURE SP_TABLES
RETURNS(
table_name char(31))
AS
BEGIN
FOR SELECT RDB$RELATION_NAME
FROM RDB$RELATIONS
WHERE (LEFT(RDB$RELATION_NAME, 4) NOT IN('RDB$', 'MON$')) AND (RDB$VIEW_SOURCE IS NULL)
INTO :TABLE_NAME
DO SUSPEND;
END

I can modify the code like this (and it works fine):

    public ObjectResult<global::System\.String\> sp\_Tables\(\)
    \{
        return base\.ExecuteFunction<global::System\.String\>\("sp\_Tables"\);
    \}

but it gets overwritten every time I upate the entity model.

I think (by comparing with model generated for SQL Server Express) that edmx file is generated Ok. The problem is in .cs associated file.

Thank you for your time.

Doru

environment: Windows 7, VS2010 Pro, C#⁠ 4.0, http://FirebirdSQL.NET provider 2.6.0, FirebirdSQL Server 2.5.1.26237

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: In Progress [ 3 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.6.1 [ 10400 ]

@firebird-automations
Copy link
Author

Commented by: Doru Constantin (doru_constantin)

Now is fixed in trunk.
Thanks.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants