Exemplo n.º 1
0
        public async Task <ICollection <StoreData> > FindStoresByName(string name)
        {
            ICollection <Store> stores = await marketStores.GetStoresByName(name);

            ICollection <StoreData> dataStores = new LinkedList <StoreData>();

            foreach (Store s in stores)
            {
                dataStores.Add(new StoreData(s));
            }
            return(dataStores);
        }
        public async Task <ICollection <ProductData> > FindProductsByStoresAsync(string name)
        {
            ICollection <Store> stores = await marketStores.GetStoresByName(name);

            ICollection <ProductData> products = new LinkedList <ProductData>();

            foreach (Store s in stores)
            {
                foreach (Product p in s.Products)
                {
                    products.Add(new ProductData(p));
                }
            }
            return(products);
        }