Dapper provides extension methods for IDbConnection. This library provides those same extensions for the Query Builder (IDbQueryBuilder) from Csg.Data.
Early releases can be found on the CSG Public MyGet feed.
Install the NuGet package
var activeProducts = await connection.QueryBuilder("dbo.Product")
.Where(x => x.FieldEquals<bool>("IsActive", true))
.QueryAsync<Product>();
- Query
- QueryAsync
- QueryFirst
- QueryFirstAsync
- QueryFirstOrDefault
- QueryFirstOrDefaultAsync
- QuerySingle
- QuerySingleAsync
- QuerySingleOrDefault
- QuerySingleOrDefaultAsync
ToDapperCommand() provides a way to build a custom Dapper execution.
var dapperCmd = connection.QueryBuilder("dbo.Product")
.Where(x => x.FieldEquals<bool>("IsActive", true))
.ToDapperCommand();
// do something with native Dapper extension methods.
var data = await connection.QueryAsync(dapperCmd);
// etc