-1

I created a Store Procedure to make tests for study its functionality.

my procedure execute two selects:

Example: Select TOP 20 * From NotaFiscal Select TOP 20 * From ProdutoNotaFiscal

Using the ADO.NET, the Dataset is filled with 2 results and generates 2 DataTables. Using Linq to SQL the type of return is a ISingleResult

I need to get the 2 returns of my procedure, but I'm not able to do that.

How can I get the result of 2 selects from procedure to LINQ?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Renato Bezerra
  • 885
  • 2
  • 8
  • 17

1 Answers1

0

You would need to create a partial class for your datacontext, and then add a method that wrap the result of your stored procedure and cast it to a IMultipleResults.

public partial class EntitiesDataContext
  {
    [Function(Name = "dbo.SPReturnMultipleResult")]
    [ResultType typeof(NotaFiscal)]
    [ResultType typeof(ProductoNotaFiscal)]
    public IMultipleResults SPReturnMultipleResult()
    {
      IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
      return ((IMultipleResults)(result.ReturnValue));
    }
alejandrobog
  • 2,091
  • 14
  • 20