Here is an example project. It was made in Visual Studio 2022 Community Edition.
It demonstrates finding the next horse racing market, opening the market and using getPrices. It also demonstrates using the pricesUpdated event to know exactly when the prices were last updated.