How to fish a fast-flowing river?

So this was my first time fishing for trout in a river, but the current was so strong that every time i casted about 45 degrees upstream, the lure would be either in front of me or downstream by the time i started to reel. How could i fish a river moving like this?