IMultipleResults 接口

定义

表示映射函数或对可变返回序列的查询的结果。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.

属性

ReturnValue

获取函数的返回值。Gets the return value of a function.

(继承自 IFunctionResult)

方法

Dispose()

执行与释放或重置非托管资源关联的应用程序定义的任务。Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

(继承自 IDisposable)
GetResult<TElement>()

检索作为指定类型的序列的下一个结果。Retrieves the next result as a sequence of a specified type.

适用于