BlueCollar.SQLiteRepository.UpdateWorkerStatus C# (CSharp) Method

UpdateWorkerStatus() public method

Updates the status of the worker with the given ID.
public UpdateWorkerStatus ( long id, WorkerStatus status, IDbTransaction transaction ) : void
id long The ID of the worker to update status for.
status WorkerStatus The status to update.
transaction IDbTransaction The transaction to use, if applicable.
return void
        public void UpdateWorkerStatus(long id, WorkerStatus status, IDbTransaction transaction)
        {
            const string Sql =
            @"UPDATE [BlueCollarWorker]
            SET
            [Status] = @Status,
            [UpdatedOn] = @Now
            WHERE
            [Id] = @Id;";

            this.connection.Execute(
                Sql,
                new
                {
                    Id = id,
                    Now = DateTime.UtcNow,
                    Status = status.ToString()
                },
                transaction,
                null,
                null);
        }