IMultipleResults Gränssnitt
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Representerar resultatet av mappade funktioner eller frågor med variabelretursekvenser.
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
- Implementeringar
Exempel
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
Kommentarer
I följande SQL-kodexempel beror resultatformen på indata (shape =1 eller shape = 2). Ordningen som projektionerna returneras är odefinierad.
Egenskaper
| Name | Description |
|---|---|
| ReturnValue |
Hämtar returvärdet för en funktion. (Ärvd från IFunctionResult) |
Metoder
| Name | Description |
|---|---|
| Dispose() |
Utför programdefinierade uppgifter som är associerade med att frigöra, frigöra eller återställa ohanterade resurser. (Ärvd från IDisposable) |
| GetResult<TElement>() |
Hämtar nästa resultat som en sekvens av en angiven typ. |