SqlMapperQueryT Method (IDbConnection, CommandDefinition) |
Executes a query, returning the data typed as per T
Namespace: DapperAssembly: VirtualRadar.Database (in VirtualRadar.Database.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public static IEnumerable<T> Query<T>(
this IDbConnection cnn,
CommandDefinition command
)
<ExtensionAttribute>
Public Shared Function Query(Of T) (
cnn As IDbConnection,
command As CommandDefinition
) As IEnumerable(Of T)
public:
[ExtensionAttribute]
generic<typename T>
static IEnumerable<T>^ Query(
IDbConnection^ cnn,
CommandDefinition command
)
[<ExtensionAttribute>]
static member Query :
cnn : IDbConnection *
command : CommandDefinition -> IEnumerable<'T>
Parameters
- cnn
- Type: System.DataIDbConnection
- command
- Type: DapperCommandDefinition
Type Parameters
- T
Return Value
Type:
IEnumerableTA sequence of data of the supplied type; if a basic type (int, string, etc) is queried then the data from the first column in assumed, otherwise an instance is
created per row, and a direct column-name===member-name mapping is assumed (case insensitive).
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).
Remarks the dynamic param may seem a bit odd, but this works around a major usability issue in vs, if it is Object vs completion gets annoying. Eg type new [space] get new object
See Also