Click or drag to resize
SqlMapperQueryTFirst, TSecond, TThird, TReturn Method (IDbConnection, String, FuncTFirst, TSecond, TThird, TReturn, Object, IDbTransaction, Boolean, String, NullableInt32, NullableCommandType)
Maps a query to objects

Namespace: Dapper
Assembly: VirtualRadar.Database (in VirtualRadar.Database.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static IEnumerable<TReturn> Query<TFirst, TSecond, TThird, TReturn>(
	this IDbConnection cnn,
	string sql,
	Func<TFirst, TSecond, TThird, TReturn> map,
	Object param = null,
	IDbTransaction transaction = null,
	bool buffered = true,
	string splitOn = "Id",
	Nullable<int> commandTimeout = null,
	Nullable<CommandType> commandType = null
)

Parameters

cnn
Type: System.DataIDbConnection
sql
Type: SystemString
map
Type: SystemFuncTFirst, TSecond, TThird, TReturn
param (Optional)
Type: SystemObject
transaction (Optional)
Type: System.DataIDbTransaction
buffered (Optional)
Type: SystemBoolean
splitOn (Optional)
Type: SystemString
The Field we should split and read the second object from (default: id)
commandTimeout (Optional)
Type: SystemNullableInt32
Number of seconds before command execution timeout
commandType (Optional)
Type: SystemNullableCommandType

Type Parameters

TFirst
TSecond
TThird
TReturn

Return Value

Type: IEnumerableTReturn

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IDbConnection. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also