This topic has not yet been rated - Rate this topic

IMultipleResults Interface

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

The IMultipleResults type exposes the following members.

  Name Description
Public property ReturnValue Gets the return value of a function. (Inherited from IFunctionResult.)
Top
  Name Description
Public method Dispose Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.)
Public method GetResult<TElement> Retrieves the next result as a sequence of a specified type.
Top

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

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ