Пример #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("main program start!");
            ItemConsumer getConsumer = new ItemConsumer();

            getConsumer.Start();
            //
            GetAllItems(getConsumer);
            try
            {
                Console.WriteLine("******************POST*************");
                List <Item>         items    = new List <Item>();
                Task <List <Item> > callTask = Task.Run(() => getConsumer.PostItemHttpTask());
                callTask.Wait();
                items = callTask.Result;
                for (int i = 0; i < items.Count; i++)
                {
                    Console.WriteLine(items[i].ToString());
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }


            Console.ReadLine();
        }
Пример #2
0
        public static void Main(string[] args)
        {
            Console.WriteLine("main program start!");
            ItemConsumer getConsumer = new ItemConsumer();

            getConsumer.Start();
            //
            GetAllItems(getConsumer);
            PostNewItem(getConsumer);


            Console.ReadLine();
        }