0

I have tables with 2 level hierarchy, Parent->Child->GrandChild I have create stored procedure with three table valued input parameter ParentTable, ChildTable, GrandChild Table.

Now, I want to consume it in .net using entity framework.

Solution all over internet is, create DataTable in .net , store data in it and pass the same as parameter in stored procedure. But, I want to use entities instead of data table as data is stored in entity objects. Please suggest. Many Thanks.

Div
  • 21
  • 5
  • It should be datatable, this is how ado.net understands it, but did you try to pass a list of entities? if yes, what error did you receive? – Haitham Shaddad Nov 29 '16 at 10:57

1 Answers1

0

You need to have look at this question

Create data table from entities and then pass it to the stored procedure. I haven't tried the code, just showing you the path to go. I hope it may help, looking for better solution.

Community
  • 1
  • 1
R K Sharma
  • 845
  • 8
  • 23
  • 42