Class BaseStatement<TResult, TType>
Base abstract class for API statement.
Inheritance
System.Object
BaseStatement<TResult, TType>
Namespace: MySqlX.XDevAPI.Common
Assembly: MySql.Data.dll
Version: 9.1.0
Syntax
public abstract class BaseStatement<TResult, TType>
where TResult : BaseResult
Type Parameters
Name | Description |
---|---|
TResult | |
TType |
Constructors
BaseStatement(BaseSession)
Initializes a new instance of the BaseStatement class based on the specified session.
Declaration
public BaseStatement(BaseSession session)
Parameters
Type | Name | Description |
---|---|---|
BaseSession | session | The session where the statement will be executed. |
Fields
_stmtId
Declaration
protected int _stmtId
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
Session
Gets the Session that owns the statement.
Declaration
public BaseSession Session { get; }
Property Value
Type | Description |
---|---|
BaseSession |
Methods
ConvertToPreparedStatement<T>(Func<T, TResult>, T, IEnumerable)
Converts a statement to prepared statement for a second execution without any change but Bind, Limit, or Offset.
Declaration
protected virtual TResult ConvertToPreparedStatement<T>(Func<T, TResult> executeFunc, T t, IEnumerable args)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult> | executeFunc | |
T | t | |
System.Collections.IEnumerable | args |
Returns
Type | Description |
---|---|
TResult |
Type Parameters
Name | Description |
---|---|
T |
Execute()
Executes the base statements. This method is intended to be defined by child classes.
Declaration
public abstract TResult Execute()
Returns
Type | Description |
---|---|
TResult | A result object containing the details of the execution. |
ExecuteAsync()
Executes a statement asynchronously.
Declaration
public async Task<TResult> ExecuteAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult> | A result object containing the details of the execution. |
SetChanged()
Sets the status as Changed for prepared statement validation.
Declaration
protected void SetChanged()
ValidateOpenSession()
Validates if the session is open and valid.
Declaration
protected void ValidateOpenSession()