// GET: CPU public ActionResult Index() { var cpus = _cpuService.GetCPUs().OrderBy(m => m.Name); var model = cpus.Select(m => new CPUViewModel { Id = m.Id, Name = m.Name }); return(View(model)); }
public ActionResult Create() { var cpus = _cpuService.GetCPUs(); ViewBag.CPUs = new SelectList(cpus, "Id", "Name"); var videoCards = _videoCardService.GetVideoCards(); ViewBag.VideoCards = new SelectList(videoCards, "Id", "Name"); var publishers = _publisherService.GetPublishers(); ViewBag.Publishers = new SelectList(publishers, "Id", "Name"); var developers = _developerService.GetDevelopers(); ViewBag.Developers = new SelectList(developers, "Id", "Name"); return(View()); }
// GET: CPUs public ActionResult Index() { var getcpu = Service.GetCPUs(); var cpus = Mapper.Map <IEnumerable <CPUdto>, IEnumerable <CPUViewModel> >(getcpu); return(View(cpus)); }