henkmollema / Dommel

CRUD operations with Dapper made simple.
MIT License
634 stars 100 forks source link

Query logging #66

Closed riguelbf closed 6 years ago

riguelbf commented 7 years ago

I would like to get the query built?

henkmollema commented 6 years ago

Dommel v2 will support logging queries. For example:

// Provide a callback to capture logs
var logs = new List<string>();
DommelMapper.LogReceived += log => logs.Add(log);

var id = await con.InsertAsync(dto, transaction);

// Optionally remove the callback when done
DommelMapper.LogReceived = null;