예제 #1
0
        public ActionResult Edit(int id)
        {
            var viewModel = Mapper.Map <Item, ItemViewModel>(SItem.SelectById(id));

            viewModel.Items =
                Mapper.Map <IEnumerable <Category>, IEnumerable <SelectListItem> >(SCategory.GetAllCategories());

            return(View(viewModel));
        }
예제 #2
0
        public ActionResult Create()
        {
            var viewModel = new ItemViewModel
            {
                Items = Mapper.Map <IEnumerable <Category>, IEnumerable <SelectListItem> >(SCategory.GetAllCategories())
            };

            return(View(viewModel));
        }