public ViewResult Index() { var groupDrugs = _groupDrugService.GetAll(); var model = _mapper.Map <IEnumerable <GroupDrugViewModel> >(groupDrugs); return (View(model)); }
public IActionResult Create() { IEnumerable <GroupDrug> groupDrugs = _groupDrugService.GetAll(); IEnumerable <Producer> producers = _producerService.GetAll(); ViewData["GroupDrugId"] = new SelectList(groupDrugs, "Id", "Name"); ViewData["ProducerId"] = new SelectList(producers, "Id", "Name"); return(View()); }