Table of Contents

Class SqlCommandExecutionContext

Namespace
LinqToDB.Internal.SqlProvider
Assembly
linq2db.dll

Threaded through the scenario interpreter; the single carrier of inter-step data. Holds one unified result value per step (rows-affected / scalar / output-parameter value / recordset marker), plus the typed rows-affected count of each executed NonQuery step. Gates, the outcome, and parameter forwarding read from it by explicit step index — nothing is pushed or declared by the producing step.

public sealed class SqlCommandExecutionContext
Inheritance
object
SqlCommandExecutionContext
Extension Methods

Constructors

SqlCommandExecutionContext(int, object?[]?)

Creates a context sized for stepCount steps.

public SqlCommandExecutionContext(int stepCount, object?[]? parameters = null)

Parameters

stepCount int

Number of steps in the scenario.

parameters object[]

The compiled-query argument array, or null for a regular query.

Properties

Parameters

The compiled-query argument array (null for a regular query). Carried on the context so it need not be threaded as a separate object?[]? argument alongside the context; the row mapper and parameter accessors read it from here.

public object?[]? Parameters { get; }

Property Value

object[]

Methods

GetResult(int)

Gets the recorded result value of a step (null if not executed).

public object? GetResult(int step)

Parameters

step int

Returns

object

SetResult(int, object?)

Records the result value of a step and marks it executed.

public void SetResult(int step, object? value)

Parameters

step int
value object

WasExecuted(int)

Whether the step has executed.

public bool WasExecuted(int step)

Parameters

step int

Returns

bool