// GET: Equipment/Create public async Task <ActionResult> Create() { try { EquipmentCreateViewModel model = new EquipmentCreateViewModel(); var fmodel = await _departmentAggregateManagementService.GetAllDepartmentsAsync(); if (fmodel != null) { model.FacilitiesModel = fmodel.Select(x => new SelectListItem() { Value = x.Id.ToString() + "#$#" + x.Name.Replace(" ", "#+#"), Text = x.Name }); } return(View(model)); } catch { return(View()); } }
// GET: Department public async Task <ActionResult> Index() { var model = await _departmentAggregateManagementService.GetAllDepartmentsAsync(); return(View(model.ToViewModel())); }