0

I am using entity framework 6 with stored procedures. Currently I deal with this problem:

Ideally I need to get data from one stored procedure. This data includes: One Conversation (basic info) + multiple Clients (which are engaged in this conversation) + Messages from Conversation.

I think that output parameters is right way to do, but i am stuck.

So, how can I do that? And is this the right way to get rows of different data from stored procedure? I am trying to avoid a solution where I would be sending recurring data about conversation with every row of the client.

2 Answers2

0

I found alternative solution with multiple result sets here and here (imho better), but this is not the answer to my question..

0

You can try with

static void Main(string[] args)
{
  using (SchoolEntities context = new SchoolEntities())
  {
    var outputParameter = new ObjectParameter(“sum”, typeof(decimal));
    context.SchoolBudgetForDateRange(new DateTime(2007, 1, 1), 
      new DateTime(2008, 1, 1), 
      outputParameter);
    Console.WriteLine(outputParameter.Value);
  }
}

where SchoolBudgetForDateRange is a stored procedure

more info here

have01
  • 1
  • 1