I am torn....

I have read a lot on this forum about how important it is to give it everything you've got. To show your children that you did everything you could to save your marriage. I want to save my marriage. I want to restore my family. I truly do. But what about when there is an affair? What kind of an example am I setting for my adult children? I do not want them to think this is acceptable behavior in any relationship.