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

        /*
         * Example of Mapping Between DimProductCategory (OAService) <-> Category (Client Model)
         *
         * ProductCategoryKey <-> Id,
         * EnglishProductCategoryName <-> Name
         *
         *
         *
         * Example of Mapping Between DimProductSubcategory (OAService) <-> Category (Client Model)
         *
         * ProductSubcategoryKey <-> Id,
         * EnglishProductSubcategoryName <-> Name
         *
         *
         * Don't spend time implementing a 3rd part mapping framework, but try to use Linq if you can
         */

        public IEnumerable <Models.Category> GetCategories()
        {
            // TODO: Get categories from OAService and map (see mapping above) to the Category client Model
            var dimCategories = oAService.GetCategories();

            var categories = (from c in dimCategories
                              select new Models.Category()
            {
                Id = c.ProductCategoryKey,
                Name = c.EnglishProductCategoryName
            }).ToList();

            return(categories);
        }
예제 #2
0
 public DimProductCategory[] GetCategories()
 {
     return(_oAService.GetCategories());
 }