Page 1 of 1

Mapping Stored procedures that return entities

Posted: Tue 03 Feb 2009 22:53
by HintonBR
How do I map a stored procedure that is has an out ref cursor as the only parameter which simply selects from a table and returns the result as a function import? I am simply trying to figure out how to do something simple like that and there doesn't seem to be any samples or anything directing what needs to happen to make it work. Am I missing the guidance? Also when I add the stored procedure to my model it imports the out parameter as a mode=In even though it is clearly an out parameter - hopefully I don't have to manually modify the SSDL for every SP
________
Strawberry Cough

Posted: Wed 04 Feb 2009 10:47
by AndreyR
Try to create function import using ADO.NET Entity Data Model Designer from the Stored Procedure and map its returning type
to the entity collection already added to the model. Ignore the Mode = "In" record in SSDL part.
When calling the created method simply set the cursor-valued parameter to null.

Posted: Wed 04 Feb 2009 19:34
by HintonBR
Thanks Andrey - that worked - this would be good to document (somewhere other than this forum) so that it is more discoverable
________
Elwood engel