public IActionResult Details(int id) { MadMenu madMenu = madmenuRepository.Get(id); MadmenuBestillingVM vm = ViewModelCreator.createMadmenuBestillingVM(madmenuRepository); vm.MadMenu = madMenu; return(View(vm)); }
public static MadmenuBestillingVM createMadmenuBestillingVM(IMadmenuRepository madmenuRepository) { return(new MadmenuBestillingVM() { Madbestillings = new Madbestillings(), MenuselectList = new SelectList(madmenuRepository.Get(), "MenuId", "MenuId"), MadMenu = new MadMenu() }); }