Table of Contents

Class EntityExtensions

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Convenience extension methods over the query builders.

public static class EntityExtensions
Inheritance
EntityExtensions
Inherited Members

Methods

PrepareFromSql<TResult>(EntityBuilder<TResult>, string)

Prepares the entity's query with the raw sql and returns a reusable prepared command, so the statement is compiled once and can be executed repeatedly.

public static IPreparedQueryCommand<TResult> PrepareFromSql<TResult>(this EntityBuilder<TResult> entity, string sql)

Parameters

entity EntityBuilder<TResult>

The builder whose query receives the raw SQL.

sql string

The SQL statement to prepare.

Returns

IPreparedQueryCommand<TResult>

A command that can be executed repeatedly.

Type Parameters

TResult

The entity type the query selects.

WithSql<TResult>(EntityBuilder<TResult>, string)

Returns the entity's command with its generated SQL replaced by the raw sql (no parameters are bound; use the overload that takes params for those).

public static QueryCommand<TResult> WithSql<TResult>(this EntityBuilder<TResult> entity, string sql)

Parameters

entity EntityBuilder<TResult>

The builder whose query receives the raw SQL.

sql string

The SQL statement to run instead of the generated one.

Returns

QueryCommand<TResult>

A command that runs the raw SQL.

Type Parameters

TResult

The entity type the query selects.

WithSql<TResult>(EntityBuilder<TResult>, string, object?)

Returns the entity's command with its generated SQL replaced by the raw sql and the public properties of params bound as named parameters.

public static QueryCommand<TResult> WithSql<TResult>(this EntityBuilder<TResult> entity, string sql, object? @params)

Parameters

entity EntityBuilder<TResult>

The builder whose query receives the raw SQL.

sql string

The SQL statement to run instead of the generated one.

params object

An object whose public properties become the statement parameters; null binds none.

Returns

QueryCommand<TResult>

A command that runs the raw SQL.

Type Parameters

TResult

The entity type the query selects.