The story is about Eliza Wharton, the daughter of a clergyman. At the beginning of the novel she has just been released from an unwanted marriage by the death of her betrothed, the Rev. Haly, also a clergyman, whom Eliza nursed during his final days in her own home. After this experience, she decides she wants friendship and independence. After a short period of time living with friends, she is courted by two men. One, Boyer, is a respected but rather boring clergyman, whom all of her friends and her mother recommend she accept in marriage. The other, Sanford, is an aristocratic libertine, who has no intention to marry but determines not to let another man have Eliza. Because of her indecision and her apparent preference for the libertine Sanford, Boyer eventually gives up on her, deciding that she will not make a suitable wife. Sanford also disappears from her life and marries another woman, Nancy, for her fortune. Eliza eventually decides that she really loved Boyer and wants him back. Unfortunately for Eliza, Boyer has already decided to marry Maria Selby, a relation of Boyer's friend. Sanford later reappears married, but is able to seduce the depressed Eliza. They have a hidden affair for some time until, overcome by guilt and unwilling to face her family and friends, Eliza arranges to escape from her home. Like the real-life Elizabeth Whitman, she dies due to childbirth complications and is buried by strangers. Mrs. Wharton (Eliza's mother) and all of Eliza's friends are deeply saddened by her death. Sanford, too, is devastated by her death. In a letter to his friend, Charles Deighton, he expresses his regret at his wretched behavior.

Question: Who does Eliza have an affair with?
Answer: Sanford.
Alternative answer: Sanford