Beispiel #1
0
        // GET: Song/Create
        public ActionResult Create()
        {
            ViewBag.Artists = artistService.GetAll().Select(a => new SelectListItem {
                Text = a.Name, Value = a.Name
            });
            ViewBag.Styles = styleService.GetAll().Select(s => new SelectListItem {
                Text = s.Name, Value = s.Name
            });

            return(View("Create"));
        }
Beispiel #2
0
        // GET: Style
        public ActionResult Index()
        {
            var styles = service.GetAll();

            var stylesViewModel = Mapper.Map <IEnumerable <Style>, IEnumerable <StyleViewModel> >(styles);

            return(View(stylesViewModel));
        }