IMultipleResults Interface

IMultipleResults Interface

.NET Framework (current version)
 

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

Namespace:   System.Data.Linq
Assembly:  System.Data.Linq (in System.Data.Linq.dll)

public interface IMultipleResults : IFunctionResult, IDisposable

NameDescription
System_CAPS_pubpropertyReturnValue

Gets the return value of a function.(Inherited from IFunctionResult.)

NameDescription
System_CAPS_pubmethodDispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.(Inherited from IDisposable.)

System_CAPS_pubmethodGetResult<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
[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));
}

.NET Framework
Available since 3.5
Return to top
Show:
© 2016 Microsoft