I'm a developer/dba in my mid-twenties working in a fairly large company. Recently, I was brought onto a project to help refactor/update a legacy codebase. My task lead (who I'll call Bob) is a bit older (early/mid-50s) and is generally a nice guy. However, he'll often talk about things that really irritate me or make well-meaning, but hurtful comments.
For example, he'll be talking about hook up culture and ask for my opinion on particular situations. Or he'll be reminiscing about some woman he did or didn't get and expecting me to give my view. I don't really mind hearing about it, but I don't really want to discuss it. Just not my style. However, he'll often preface the whole thing with "As a woman, what's your opinion on [insert topic here]?" And I'll feel obligated to give some kind of answer. I can deal with it, but it annoys me and I'd rather find a way to redirect the conversation.
On a similar note, Bob will sometimes make comments or do things that end up making me feel a bit hurt. For example, he'll tell me that I shouldn't have such high standards when it comes to dating (and seeming to insinuate that if I don't, I'll end up alone). I've never really had a problem with dating, but comments like that still hurt. He's also tried multiple times (unbeknownst to me) to set me up with some of my male coworkers, which I consider borderline inappropriate and something I'd prefer to avoid.
This is all stuff that is annoying/mildly hurtful, but is mostly manageable because Bob only talks about this stuff if no one else is around. However, the thing which I absolutely cannot stand is that he'll almost always make some comment that draws attention to my gender when we're meeting with clients. I'm often the only woman in a group of 20+ guys and it just makes me feel so awkward. I don't want to be rude or offend Bob because he means well, is a genuinely nice guy, and we get along really well otherwise (we both love football, are really into cooking, can talk about random stuff for ages), but I want the rest to stop.
How can I redirect the conversation/avoid discussing certain subjects without making things awkward or offending Bob?