LINQ to SQL stored procedures with multiple results in Visual Studio 2008

Posted by Jeremy on Stack Overflow See other posts from Stack Overflow or by Jeremy
Published on 2010-02-02T21:06:28Z Indexed on 2010/05/21 23:10 UTC
Read the original article Hit count: 252

I'm using visual studio 2008 and I've created a stored procedure that selects back two different result sets. I drag the stored proc on to a linq to sql dbml datacontext class, causing visual studio to create the following code in the cs file:

[Function(Name="dbo.List_MultiSelect")]
public ISingleResult<DataAccessLayer.DataEntities.List_MultiSelectResult> List_MultiSelect()
{
    IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
    return ((ISingleResult<DataAccessLayer.DataEntities.List_MultiSelectResult>)(result.ReturnValue));
}

Shouldn't the designer generate the code to use IMultipleResults? Or do I have to hand code that?

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about stored-procedures