0
votes

How to call store procedure which returns data from more than one table from entity framework 4.0 in dot net 3.5 . As while generating import function from store procedure , complex data type is not allowed in dot.net 3.5 .Same thing works fine with dot net framework 4.0 . Is there any way out to work with dot net framework 3.5 using entity framework 4.0

1

1 Answers

0
votes

I don't believe it's supported in EF 4.0 I do know that it's supported in EF 6.0

I'd recommend upgrading if it's possible.

Here's some sample code I found (link provided below)

public virtual int AddCustomerInDivision(Nullable<int> CustId, string Division)
{
  var CustIdParameter = CustId.HasValue ?
    new ObjectParameter("CustId", CustId) :
    new ObjectParameter("CustId", typeof(int));

  var DivisionParameter = Division != null ?
    new ObjectParameter("Division", Division) :
    new ObjectParameter("Division", typeof(string));

  return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction(
    "DeleteCustomer", CustIdParameter, DivisionParameter);
}

Link to Article