If the OP is unhappy buying a codeshare ticket, then he/she can purchase one directly from US. He/she can credit his/her mileage to US or UA (or LH or BMI, etc.).
Codeshares aren't seamless. One has to check-in on another airline's website (or at their counters), and then fly on their airplanes. I'm pretty sure they let you know this when you buy the ticket...