Esempio n. 1
0
        public void ShowSearchResultB()
        {
            var foodsSearch  = new FoodSearchService().Search();
            var fruitsSearch = new FruitSearchService().Search();

            var foods = foodsSearch.Result;

            foods.ForEach(f => Console.WriteLine("food:{0}", f.Name));

            Console.WriteLine("done");
        }
Esempio n. 2
0
        public async Task ShowSearchResultA()
        {
            var foodsSearch  = new FoodSearchService().Search();
            var fruitsSearch = new FruitSearchService().Search();

            var foods = await foodsSearch;

            foods.ForEach(f => Console.WriteLine("food:{0}", f.Name));

            Console.WriteLine("done");
        }
Esempio n. 3
0
        public void ShowSearchResultB()
        {
            var foodsSearch = new FoodSearchService().Search();
            var fruitsSearch = new FruitSearchService().Search();

            var foods = foodsSearch.Result;

            foods.ForEach(f => Console.WriteLine("food:{0}", f.Name));

            Console.WriteLine("done");
        }
Esempio n. 4
0
        public async Task ShowSearchResultA()
        {
            var foodsSearch = new FoodSearchService().Search();
            var fruitsSearch = new FruitSearchService().Search();

            var foods = await foodsSearch;

            foods.ForEach(f => Console.WriteLine("food:{0}", f.Name));

            Console.WriteLine("done");
        }
Esempio n. 5
0
        public void ShowSearchResultC()
        {
            var foodsSearch  = new FoodSearchService().Search();
            var fruitsSearch = new FruitSearchService().Search();

            var callback = foodsSearch as ICallBackRegister;

            callback.Register <List <Food> >(foods =>
            {
                foods.ForEach(f => Console.WriteLine("food:{0}", f.Name));
                Console.WriteLine("done");
            }).Await(foodsSearch);
        }
Esempio n. 6
0
        public void ShowSearchResultC()
        {
            var foodsSearch = new FoodSearchService().Search();
            var fruitsSearch = new FruitSearchService().Search();

            var callback = foodsSearch as ICallBackRegister;
            callback.Register<List<Food>>(foods =>
            {
                foods.ForEach(f => Console.WriteLine("food:{0}", f.Name));
                Console.WriteLine("done");
            }).Await(foodsSearch);

        }