I have an existing database with lots of complex stored procedure and I want to use those procedure through EF 4. I have done the following:
- Created an EF data object,
Customer
.
- Added a Stored Procedure into the EF
- Right Click on the EF designer and add a function import.
- Function Import Name -
MyFunction
, complex type.
Resulting code:
CustomerEntities entity = new CustomerEntities();
var result = entity.MyFunction("XYZ", ref o_MyString);
Now my stored procedure has an output parameter which I used to call by the ref (in WebForm). But I am getting the below error:
cannot convert from 'ref string' to
'System.Data.Objects.ObjectParameter'
Please help
Edit
When I am trying to save I am getting the below error
A mapping function binding specifies a function Model.Store.P_GetCustomer with an unsupported parameter: o_MyString. Output parameters may only be mapped through the RowsAffectedParameter property. Use result bindings to return values from a function invocation.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…