// GET: NailPolish
        public ActionResult Index()
        {
            var nailPolishesViewModels = new List <NailPolishViewModel>();
            var nailPolishesData       = nailPolishesService.GetAll();

            nailPolishesViewModels = AutoMapper.Mapper.Map <List <NailPolishViewModel> >(nailPolishesData);

            return(View(nailPolishesViewModels));
        }
Exemple #2
0
        public ActionResult Create()
        {
            ViewBag.Message = "Creating a catalog.";
            var nailPolishesData = nailPolishesService.GetAll();
            var catalog          = new CatalogInputModel();

            foreach (var item in nailPolishesData)
            {
                var nailPolishes = AutoMapper.Mapper.Map <NailPolishInputModel>(item);
                catalog.NailPolishes.Add(nailPolishes);
            }

            return(View(catalog));
        }