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
dbContextDbContextThe DbContext instance.
sqlstringThe SQL query.
parametersKeyValuePair<string, object>[]The parameters for the SQL query.
Returns
- List<T>
A list of objects mapped from the SQL query result.
Type Parameters
TThe type of the objects.