IMultipleResults IMultipleResults IMultipleResults IMultipleResults Interface

定義

以變數傳回順序表示已對應函式或查詢的結果。Represents the results of mapped functions or queries with variable return sequences.

public interface class IMultipleResults : IDisposable, System::Data::Linq::IFunctionResult
public interface IMultipleResults : IDisposable, System.Data.Linq.IFunctionResult
type IMultipleResults = interface
    interface IFunctionResult
    interface IDisposable
Public Interface IMultipleResults
Implements IDisposable, IFunctionResult
實作

範例

CREATE PROCEDURE VariableResultShapes(@shape int)  
AS  
if(@shape = 1)  
    select CustomerID, ContactTitle, CompanyName from customers  
else if(@shape = 2)  
    select OrderID, ShipName from orders  
[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));
}
<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

備註

在下列 SQL 程式碼範例中,結果圖案會根據輸入 (shape =1shape = 2) 而不同。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.

方法

Dispose() Dispose() Dispose() Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(Inherited from IDisposable)
GetResult<TElement>() GetResult<TElement>() GetResult<TElement>() GetResult<TElement>()

依照指定型別的順序擷取下一個結果。Retrieves the next result as a sequence of a specified type.

屬性

ReturnValue ReturnValue ReturnValue ReturnValue

取得函式的傳回值。Gets the return value of a function.

(Inherited from IFunctionResult)

適用於