This is a migrated thread and some comments may be shown as answers.

CUD Mapping, Insert does not accept SP without parameter

4 Answers 83 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pierick Mellerin
Top achievements
Rank 1
Pierick Mellerin asked on 30 Mar 2011, 10:30 AM

Hello,

I have an entity/table with two fields:

Id (identity, database calculated)
RowVersion (Timestamp)

In CUD Mapping, if I select "Map Procedure" for Create SP (without parameter, by design) and I update "Database from Model...", The following error is displayed:

System.InvalidOperationException

So, is it possible to map a stored procedure for INSERT without parameter like this:

CREATE PROCEDURE [dbo].[sp_oa_ins__myTable]
AS
    INSERT INTO myTable DEFAULT VALUES
    SELECT scope_identity()
GO

Thanks in advance.

Pierrick

4 Answers, 1 is accepted

Sort by
0
Pierick Mellerin
Top achievements
Rank 1
answered on 31 Mar 2011, 07:37 AM
[Addendum]
With Entity Framework 4, there is no problem to associate (mapping) a SP like this (INSERT SP without parameter, by example for a table with two fields: Identity field (Id) and Timestamp field (version field)) with an entity... So, is it a bug for OpenAccess and is it a normal behavior (by design) ? Thanks.
0
Damyan Bogoev
Telerik team
answered on 31 Mar 2011, 10:09 PM
Hello Pierick Mellerin,

Firstly I want to apologize for the inconvenience caused.
It seems to be an issue in the sql generation for stored procedures that are used in CUD mapping scenario. We will do our best to fix the cause for this issue.

Regards,
Damyan Bogoev
the Telerik team
0
Pierick Mellerin
Top achievements
Rank 1
answered on 27 Jun 2011, 12:09 PM
Hello,

I have tested the latest version of OpenAccess (v2011.1.510.1) and the issue is always there: it is not possible to generate a CRUD Insert procedure when the table contains only an identity and a timestamp columns, for example.

Is there any roadmap about the fix of this problem ?

Thanks in advance.

Pierrick
0
Damyan Bogoev
Telerik team
answered on 30 Jun 2011, 11:59 AM
Hi Pierick Mellerin,

I am afraid that the problem is not fixed yet. We will do our best to fix the issue for the next Q2 release.
I am sorry for the inconvenience caused.

Regards,
Damyan Bogoev
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
Tags
Getting Started
Asked by
Pierick Mellerin
Top achievements
Rank 1
Answers by
Pierick Mellerin
Top achievements
Rank 1
Damyan Bogoev
Telerik team
Share this question
or