Method RawSql
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
DbContextThe DbContext instance.
sql
stringThe 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.