IMultipleResults Interface
.NET Framework (current version)
Represents the results of mapped functions or queries with variable return sequences.
Assembly: System.Data.Linq (in System.Data.Linq.dll)
| Name | Description | |
|---|---|---|
![]() | ReturnValue | Gets the return value of a function.(Inherited from IFunctionResult.) |
| Name | Description | |
|---|---|---|
![]() | Dispose() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.(Inherited from IDisposable.) |
![]() | GetResult(Of TElement)() | Retrieves the next result as a sequence of a specified type. |
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.
CREATE PROCEDURE VariableResultShapes(@shape int)
AS
if(@shape = 1)
select CustomerID, ContactTitle, CompanyName from customers
else if(@shape = 2)
select OrderID, ShipName from orders
<FunctionAttribute(Name:="dbo.VariableResultShapes"), _ ResultType(GetType(VariableResultShapesResult1)), _ ResultType(GetType(VariableResultShapesResult2))> _ Public Function VariableResultShapes(<Parameter(DbType:="Int")> ByVal shape As System.Nullable(Of Integer)) As IMultipleResults Dim result As IExecuteResult = Me.ExecuteMethodCall(Me, CType(MethodInfo.GetCurrentMethod, MethodInfo), shape) Return CType(result.ReturnValue, IMultipleResults) End Function
.NET Framework
Available since 3.5
Available since 3.5
Show:
.jpeg?cs-save-lang=1&cs-lang=vb)
.jpeg?cs-save-lang=1&cs-lang=vb)