
315 S.E.2d 759 (1984)
Donald S. COLLINS
v.
Beverly Ann DAVIS (Williams).
No. 8325SC282.
Court of Appeals of North Carolina.
June 5, 1984.
*760 Tate, Young, Morphis, Bogle & Bach by Thomas C. Morphis, Hickory, for plaintiff-appellant.
Randy D. Duncan, Hickory, for defendant-appellee.
PHILLIPS, Judge.
Though the sole question presented for review is whether the trial court erred in directing a verdict against plaintiff and dismissing his case, answering it is a two step process. So far as the record reveals, the dismissal was on the grounds of public policy and the sufficiency of the evidence was not a factor; nevertheless, if the evidence in fact was insufficient to support any of the claims asserted, plaintiff had no right to a jury trial and the directed verdict was proper. Thus, before discussing the grounds upon which the case was apparently dismissed, we will first determine whether it was dismissable in any event because plaintiff's evidence was insufficient to raise *761 a jury question on either of the alternative claims allegedresulting trust, unjust enrichment, and a loan of money and furnishing of labor upon a promise to pay therefor. In doing so, of course, we are obliged to view the evidence in the light most favorable to plaintiff. Hawks v. Brindle, 51 N.C.App. 19, 275 S.E.2d 277 (1981).
Equity devised the theory of resulting trust to effectuate the intent of the parties in certain situations where one party pays for property, or part of it, that for different reasons is titled in the name of another. In Minis v. Minis, 305 N.C. 41, 46-47, 286 S.E.2d 779, 783-784 (1982), our Supreme Court said:
A resulting trust arises "when a person becomes invested with the title to real property under circumstances which in equity obligate him to hold the title and to exercise his ownership for the benefit of another.... A trust of this sort does not arise from or depend on any agreement between the parties. It results from the fact that one man's money has been invested in land and the conveyance taken in the name of another." (Citation omitted). The trust is created in order to effectuate what the law presumes to have been the intention of the parties in these circumstancesthat the person to whom the land was conveyed hold it as trustee for the person who supplied the purchase money. (Citations omitted). "The classic example of a resulting trust is the purchase-money resulting trust. In such a situation, when one person furnishes the consideration to pay for land, title to which is taken in the name of another, a resulting trust commensurate with his interest arises in favor of the one furnishing the consideration...." (Citation omitted).
As to this claim, plaintiff testified that: At least $4,500 of plaintiff's money, placed in defendant's checking account, was used with his consent in purchasing or paying for the property that was titled in her name; the money was not a gift, but was given to her because of their agreement that if they got married title would be put in both their names, and if they did not marry the property would be sold and he would be paid from the proceeds. This evidence, in our view, was sufficient to support the claim that a resulting trust in plaintiff's favor existed with respect to the property involved.
The doctrine of unjust enrichment was devised by equity to exact the return of, or payment for, benefits received under circumstances where it would be unfair for the recipient to retain them without the contributor being repaid or compensated. To invoke the unjust enrichment doctrine, however, more must be shown than that one party voluntarily benefited another or his property. Wright v. Wright, 305 N.C. 345, 289 S.E.2d 347 (1982). One situation where the doctrine does arise, though, is where one's property is improved or paid for in reliance upon the owner's unenforceable promise to convey the land or some interest in it to the contributor. Union Central Life Insurance Co. v. Cordon, 208 N.C. 723, 182 S.E. 496 (1935). Quite clearly, we think, plaintiff's evidence falls under the authority of this case and was sufficient to support plaintiff's unjust enrichment claim. And, of course, that the evidence referred to also supports the other claim that the money was loaned and labor was done in reliance upon defendant's promise to pay therefor is too plain to require discussion.
Since plaintiff's evidence was sufficient to support the claims alleged, was the case dismissable on the grounds of public policy, as the trial court ruled? In directing a verdict against plaintiff, the court stated:
"[I]t is undisputed that the parties knew plaintiff was married at the time of the purchase of the house, and that plaintiff was married during the time the parties lived together and actually remained married until August 1982, and that, as a matter of law, the plaintiff is not entitled to equitable relief under the totality of the evidence, in that the arrangement violates the public policy of North Carolina and is in derogation of the sanctity of marriage and other laws...."
*762 Though the evidence does show, as the court stated, that during the period the parties lived together and the house was bought, plaintiff was married to another woman, as defendant well knew, we nevertheless are of the opinion that that did not authorize the court to dismiss plaintiff's case. The court's judgment, in effect, stands for the proposition that couples living together while one is known to be still married to another are incapable of entering into enforceable express or implied contracts for the purchase and improvement of houses, or for the loan and repayment of money. So far as we have been able to ascertain, that proposition is not the law of this state, or any other, for that matter. Our research has discovered no authority or case to that effect, and defendant's brief refers us to none. Of course, if the money that plaintiff gave defendant and the work that he did on the place was in payment or consideration for illicit sexual intercourse, as defendant contends, all of the claims would be founded on illegality and thus unenforceable. But the record contains no testimony that plaintiff paid or did what he did in payment for illicit intercourse that had already occurred, or in exchange for defendant's promise to continue the illicit relationship in the future; and, if plaintiff's evidence is nevertheless susceptible to that interpretation, and we are inclined to believe that it is, that certainly is not the only way it can be interpreted. Thus, the question was one of fact for the jury, rather than one of law for the court. Furthermore, under our law, illegality is an affirmative defense and the burden of proving it is on the one that asserts it. Rule 8(c), N.C.Rules of Civil Procedure; Rose v. Vulcan Materials Co., 282 N.C. 643, 194 S.E.2d 521 (1973); Brown v. Kinsey, 81 N.C. 245 (1879).
The court may have dismissed plaintiff's case in reliance upon the "Clean Hands" doctrine; but this doctrine has no application to the circumstances recorded. Equity is not limited to those that have led blameless lives; its doors are not automatically closed to those that are immoral. 30 C.J.S. Equity § 98 (1965). The clean hands doctrine denies equitable relief only to litigants who have acted in bad faith, or whose conduct has been dishonest, deceitful, fraudulent, unfair, or overreaching in regard to the transaction in controversy. 27 Am.Jur.2d Equity § 136 (1966). Our Supreme Court, in discussing this principle, has said: "`Clean hands' connotes absence of sharp practice and bad faith on the part of the party seeking equity, not complete freedom from negligence and gullibility." Branch Banking & Trust Company v. Gill, State Treasurer, 286 N.C. 342, 364, 211 S.E.2d 327, 342 (1975). Though the record clearly shows that the parties were involved in an immoral relationship, it contains no evidence that plaintiff acted dishonestly, deceitfully, fraudulently, or unfairly either toward the defendant personally or with respect to the purchase and improvement of the property that is the subject of this case. So while we disapprove of plaintiff's breach of his marital vows to his former wife, who is not involved in this case, and his immoral liason with the defendant, we nevertheless are constrained to hold that neither the doors of law nor equity are closed to him in this case.
The judgment appealed from is therefore reversed and a new trial ordered.
New trial.
WELLS, J., concurs in result.
BRASWELL, J., dissents.
BRASWELL, Judge, dissenting:
I respectfully dissent and would vote to affirm the order of the trial judge.
At the willing risk of being called an old fogy, I cannot accept that it is either equity or law to place the stamp of approval of public policy upon the undisputed facts in this case. Adultery is still against the law in North Carolina. Living in adultery is the consideration that formed the basis of this real estate transaction. Each party knew that the plaintiff was married to another at all the times involved. The man, the plaintiff, has in legal effect, given a *763 gift to his paramour. The illegal relationship bars the plaintiff's right to any recovery.
Here, the parties did not live together under color of marriage in a good faith belief of a legal marriage. In such a situation equity would come to the aid of the parties in a division of property acquired during the relationship.
It strains the public policy of the law against adultery to contrive to aid nonmarital cohabitation by engrafting any form of resulting trust or unjust enrichment theory on the illicit conduct in this record. The court should not lend its hand to aid either party. See Annot., 3 A.L.R. 4th, 13, 49 (1981).
