Пример #1
0
        static void Main(string[] args)
        {
            var baseUrl         = "https://localhost:5001/api/";
            var promotionFinder = new PromotionFinder(baseUrl);

            promotionFinder.PollForCheapProducts(2000);

            Console.WriteLine("Press any key to stop polling");
            Console.ReadKey();

            Console.WriteLine("Press any key to close the program");
            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            var baseUrl         = "https://localhost:5001/api/";
            var promotionFinder = new PromotionFinder(baseUrl);

            // TODO (bonus):
            // Provide a cancellation token
            promotionFinder.PollForCheapProducts(2000);

            Console.WriteLine("Press any key to stop polling");
            Console.ReadKey();

            // TODO (bonus):
            // Cancel the polling loop

            Console.WriteLine("Press any key to close the program");
            Console.ReadKey();
        }