Marriage is encouraged by the law. Every effort to restrain or discourage marriage by contract, condition, limitation, or otherwise shall be invalid and void, provided that prohibitions against marriage to a particular person or persons or before a certain reasonable age or other prudential provisions looking only to the interest of the person to be benefited and not in general restraint of marriage will be allowed and held valid.