Esempio n. 1
0
        public IEnumerable <Product> GetProducts(string sourceIndicator)
        {
            var products = new List <Product>();

            using (Stream stream = sourceProvider.Load(sourceIndicator))
            {
                var reader = sourceReader.Create(stream);
                while (reader.Read())
                {
                    var product = productMapper.Map(reader);

                    if (product != null)
                    {
                        products.Add(product);
                    }
                }
            }

            return(products);
        }