Table of Contents

Method RawSql

Namespace
Innova.Data
Assembly
Innova.Data.dll

RawSql<T>(DbContext, string, params KeyValuePair<string, object>[])

Executes a raw SQL query and maps the result to a list of objects.

public static List<T> RawSql<T>(this DbContext dbContext, string sql, params KeyValuePair<string, object>[] parameters)

Parameters

dbContext DbContext

The DbContext instance.

sql string

The SQL query.

parameters KeyValuePair<string, object>[]

The parameters for the SQL query.

Returns

List<T>

A list of objects mapped from the SQL query result.

Type Parameters

T

The type of the objects.