Example #1
0
        public ActionResult Create()
        {
            ProductAddVM model      = new ProductAddVM();
            var          categories = _categoryRepository.GetAll();
            var          mapper     = MyAutoMapperConfig.GetAutoMapper();
            // сопоставление
            var select = mapper.Map <List <SelectItemVM> >(categories);

            model.SetCategoriesSelect(select);

            return(View(model));
        }