Quantum meruit
From Conservapedia
Quantum meruit is a legal doctrine implying a promise to pay for goods or services received. This establishes a right to be paid in the absence of an actual contract.
If there is an express contract for payment, then quantum meruit does not apply.
Modern rules of pleading claims allow plaintiffs to assert both theories of recovery in the alternative, so that if one theory fails (e.g., the court finds a lack of contract) then the other theory of recovery may succeed.