BlueCollar.SQLiteRepository.DeleteWorker C# (CSharp) Method

DeleteWorker() public method

Deletes the worker record with the given ID.
public DeleteWorker ( long id, IDbTransaction transaction ) : void
id long The ID of the worker to delete.
transaction IDbTransaction The transaction to use, if applicable.
return void
        public void DeleteWorker(long id, IDbTransaction transaction)
        {
            const string Sql =
            @"DELETE FROM [BlueCollarWorking]
            WHERE
            [WorkerId] = @Id;

            DELETE FROM [BlueCollarHistory]
            WHERE
            [WorkerId] = @Id;

            DELETE FROM [BlueCollarWorker]
            WHERE
            [Id] = @Id;";

            this.connection.Execute(
                Sql,
                new { Id = id },
                transaction,
                null,
                null);
        }