3

Within EF4, it's pretty easy to map a stored procedure into an entity. I create the stored proc, Add it to the model, then do a Function Import and specify the parent entity.

Now, the rub comes in that I want my stored proc to do "eager loading" of the children entities.

In effect, I have a table Parents and a table Children, with a one to many relationship between them. I'd like my stored proc to return all Parents that match a criteria and all Children of those parents, distributed into the entity model as one would imagine.

How is this accomplished?

JustLoren
  • 3,224
  • 3
  • 27
  • 34

1 Answers1

1

Assuming you mean that you want your stored procedure to return multiple result sets, you may want to have a look at this question.

The basic gist is that this isn't supported as an out-of-the-box feature, but there's an extension to EF that evidently makes this possible.

Community
  • 1
  • 1
Adam Robinson
  • 182,639
  • 35
  • 285
  • 343