public HistoryDetailsRecord GetHistoryDetails(long id, IDbTransaction transaction)
{
const string Sql =
@"SELECT
h.[Id],
h.[Data],
h.[Exception],
h.[QueuedOn],
w.[MachineAddress] AS [WorkerMachineAddress],
w.[MachineName] AS [WorkerMachineName],
w.[Name] AS [WorkerName]
FROM [BlueCollarHistory] h
INNER JOIN [BlueCollarWorker] w ON h.[WorkerId] = w.[Id]
WHERE
h.[Id] = @Id;";
return this.connection.Query<HistoryDetailsRecord>(
Sql,
new { Id = id },
transaction,
true,
null,
null).FirstOrDefault();
}