I have a stored procedure such as the following:
PROCEDURE JustTesting(curParam OUT SYS_REFCURSOR) AS
BEGIN
OPEN curParam FOR
SELECT *
FROM MyTable;
END JustTesting;
I have followed the instructions as outlined here: http://www.devart.com/dotconnect/oracle ... rsors.html
I have used the ADO.NET POCO Entity Generator to provide the model and context templates and generated the relevant classes.
The context now contains the following method relating to my function:
public ObjectResult JustTesting()
{
return base.ExecuteFunction("JustTesting");
}
Calling this method raises an error such as: "The data reader is incompatible with the specified MyModel.JustTestingResult'. A member of the type, 'MyTestId', does not have a corresponding column in the data reader with the same name."
Now, the reason for this is that the column in the database is named "My_Test_Id" not MyTestId. So, I can rename this in the JustTestingResult complex type (and this will work), but then why should my conceptual model have to be tightly coupled with the physical model? So, the question is, how do I map between MyTestId and My_Test_Id?
Thanks
Stored Procedure Parameter Mapping
This problem is caused by Entity Framework code.
You can find the reason in the note to this article:
You can find the reason in the note to this article:
The solution is to leave underscores in the model or to create correct aliases in the procedure code.For a function import to return an EntityType, the columns returned by the corresponding stored procedure must exactly match the scalar properties of the returned EntityType.
Thanks for the response. I assume you are dependant on EF then and can't incorporate something your side that can rectify this?AndreyR wrote:This problem is caused by Entity Framework code.
You can find the reason in the note to this article:The solution is to leave underscores in the model or to create correct aliases in the procedure code.For a function import to return an EntityType, the columns returned by the corresponding stored procedure must exactly match the scalar properties of the returned EntityType.
Thanks again
We have released a new build with the Result Set Mapping support yesterday. This build can be downloaded from the Download page (the trial version) or from Registered Users' Area (for users with active subscription only).
For the detailed information about the fixes and improvements available in dotConnect for Oracle 6.10.103, please refer to this post.
For the detailed information about the fixes and improvements available in dotConnect for Oracle 6.10.103, please refer to this post.