BlueCollar.SQLiteRepository.UpdateWorkerStatus C# (CSharp) 메소드

UpdateWorkerStatus() 공개 메소드

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.
리턴 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);
        }