// TODO: Include OAService, this will allow you to query the webservice

        /*
         * Example of Mapping Between DimProduct (OAService) <-> Product Mapping (Client Model)
         *
         * EnglishProductName <-> Name
         * ProductKey <-> ProductKey
         * SafetyStockLevel <-> StockLevel
         *
         *
         * Don't spend time implementing a 3rd part mapping framework, but try to use Linq if you can
         */

        public IEnumerable <Product> GetProducts()
        {
            // TODO: Get Products from OAService and map (see mapping above) to the Product client Model
            // (Return only 100 results)
            var dimProducts = oAService.GetProducts().Take(100);

            var products = (from p in dimProducts
                            select new Product()
            {
                Name = p.ModelName,
                ProductKey = p.ProductKey,
                StockLevel = p.SafetyStockLevel
            }).ToList();

            return(products);
        }
Пример #2
0
 public IEnumerable <DimProduct> GetProducts()
 {
     return(_oAService.GetProducts());
 }