> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# TursoPreparedStatement

> Represents a prepared SQL statement that can be executed multiple times             with different parameters for improved performance.

## Definition

**Assembly:** CloudNimble.BlazorEssentials.TursoDb.dll

**Namespace:** CloudNimble.BlazorEssentials.TursoDb

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
CloudNimble.BlazorEssentials.TursoDb.TursoPreparedStatement<TResult>
```

## Summary

Represents a prepared SQL statement that can be executed multiple times
with different parameters for improved performance.

## Type Parameters

* `TResult` - The type of result returned by queries.

## Examples

```csharp theme={"dark"}
var statement = Database.Prepare&lt;User&gt;("SELECT * FROM users WHERE age &gt; ?");
var youngUsers = await statement.QueryAsync(18);
var olderUsers = await statement.QueryAsync(65);
```

## Constructors

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### &#x20;Sql

Gets the SQL statement.

#### Syntax

```csharp theme={"dark"}
public string Sql { get; }
```

#### Property Value

Type: `string`

### &#x20;StatementId

Gets the unique identifier for this prepared statement.

#### Syntax

```csharp theme={"dark"}
public string StatementId { get; }
```

#### Property Value

Type: `string`

## Methods

### &#x20;DisposeAsync

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.ValueTask DisposeAsync()
```

#### Returns

Type: `System.Threading.Tasks.ValueTask`

### &#x20;Equals Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `obj` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;Equals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;GetHashCode Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### &#x20;GetType Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### &#x20;MemberwiseClone Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### &#x20;QueryAsync

Executes the prepared statement as a query and returns all matching rows.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>> QueryAsync(params object[] parameters)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `parameters` | `object?[]` | The parameters for the statement. |

#### Returns

Type: `System.Threading.Tasks.Task<System.Collections.Generic.List<TResult>>`
A list of matching results.

### &#x20;QuerySingleAsync

Executes the prepared statement as a query and returns the first matching row or null.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<TResult> QuerySingleAsync(params object[] parameters)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `parameters` | `object?[]` | The parameters for the statement. |

#### Returns

Type: `System.Threading.Tasks.Task<TResult?>`
The first matching result or null.

### &#x20;ReferenceEquals Inherited

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `objA` | `object?` | - |
| `objB` | `object?` | - |

#### Returns

Type: `bool`

### &#x20;ToString Inherited Virtual

> [!NOTE]
>
> Inherited from `object`

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`

## Related APIs

* System.IAsyncDisposable


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.