public ActionResult Index() { var data = _plasticService.GetAllIncludingLocation(); var model = data.Select(x => new PlasticViewModel(x)).ToList(); return(View(model)); }
public async Task <PartialViewResult> LoadForm(int?id) { var plastics = _plasticService.GetAllIncludingLocation().ToList(); return(PartialView("_Modal", id == null ? new PlasticSpoolViewModel(plastics) : new PlasticSpoolViewModel(await _plasticSpoolService.Get(new EntityDto((int)id)), plastics))); }