BlueCollar.SQLiteRepository.GetWorkingSignals C# (CSharp) Method

GetWorkingSignals() public method

Gets the current signals set for a worker and a working job, if applicable.
public GetWorkingSignals ( long workerId, long workingId, IDbTransaction transaction ) : SignalsRecord
workerId long The ID of the worker to get a signal for.
workingId long The ID of the working job to get a signal for, if applicable.
transaction IDbTransaction The transaction to use, if applicable.
return SignalsRecord
        public SignalsRecord GetWorkingSignals(long workerId, long? workingId, IDbTransaction transaction)
        {
            const string Sql =
            @"SELECT w.[Signal] AS [WorkerSignal], w.[QueueNames], wg.[Signal] AS [WorkingSignal]
            FROM [BlueCollarWorker] w
            LEFT OUTER JOIN [BlueCollarWorking] wg ON w.[Id] = wg.[WorkerId] AND wg.[Id] = @WorkingId
            WHERE
            w.[Id] = @WorkerId;";

            return this.connection.Query<SignalsRecord>(
                Sql,
                new
                {
                    WorkerId = workerId,
                    WorkingId = workingId
                },
                transaction,
                true,
                null,
                null).FirstOrDefault();
        }