I am trying to call a stored procedure in an Entity Framework 4 application and still get strange results. The stored procedure accepts parameters INand OUTand returns the results. I matched the stored procedure and created a complex type that represents a string in the returned result set. I call it
using (MyObjectContext ctx = new MyObjectContext())
{
ObjectParameter out1 = new ObjectParameter("out1", typeof(String));
ObjectParameter out2 = new ObjectParameter("out2", typeof(String));
var res = ctx.my_proc(1,2, out1,out2);
}
The problem is that if I did not call res.ToList()(or has not transferred through resor will not cause any of the methods that apply to the main collection) values out1and out2are equal null.
How to fix it? Thanks
source
share