Edit

Share via


IMultipleResults Interface

Definition

Represents the results of mapped functions or queries with variable return sequences.

C#
public interface IMultipleResults : IDisposable, System.Data.Linq.IFunctionResult
Implements

Examples

CREATE PROCEDURE VariableResultShapes(@shape int)  
AS  
if(@shape = 1)  
    select CustomerID, ContactTitle, CompanyName from customers  
else if(@shape = 2)  
    select OrderID, ShipName from orders  
C#
[Function(Name="dbo.VariableResultShapes")]
[ResultType(typeof(VariableResultShapesResult1))]
[ResultType(typeof(VariableResultShapesResult2))]
public IMultipleResults VariableResultShapes([Parameter(DbType="Int")] System.Nullable<int> shape)
{
    IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), shape);
    return ((IMultipleResults)(result.ReturnValue));
}

Remarks

In the following SQL code example, the result shape depends on the input (shape =1 or shape = 2). The order that the projections are returned is undefined.

Properties

ReturnValue

Gets the return value of a function.

(Inherited from IFunctionResult)

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(Inherited from IDisposable)
GetResult<TElement>()

Retrieves the next result as a sequence of a specified type.

Applies to

Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1