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:
Output parameters are returned in ObjectParameter instance. So you must use code like:
var oMyString = new ObjectParameter("o_MyString", typeof(string));
var result = ctx.MyFunction("XYZ", oMyString).ToList();
var data = oMyString.Value.ToString();
The reason is that function import cannot use ref parameter because output parameter is not filled until you process result set from the database = if you don't call ToList or iterate the result of the stored procedure the output parameter is null.