Associate a stored procedure with an Entity object and its children

Inside EF4, it is fairly easy to map a stored procedure to an entity. I create a saved proc, add it to the model, then import the function and set the parent object.

Now, in rub, I want my saved proc to eagerly load child objects.

In fact, I have a Parents table and a Children table, between which there is a one-to-many relationship. I would like my saved proc to return all the parents that match the criteria, and all the children of these parents that were common in the entity model, as you might imagine.

How is this achieved?

+3
source share
1 answer

Assuming you want your stored procedure to return multiple result sets, you might want to look at this question .

The main point is that this is not supported as a ready-made function, but there is an extension for EF, which obviously makes this possible.

+1
source

Source: https://habr.com/ru/post/1755528/


All Articles