private void SetModel(DepartmentViewModel model) { model.DepartmentListItems = _departmentService.Find(a => true).Select(a => new ListItemEntity() { ID = a.DepartmentId, ParentID = a.ParentId, Title = a.DepartmentName, Selected = (a.DepartmentId == model.DepartmentId) }).ToList(); model.DistributorListItems = _distributorService.Find(a => true).Select(a => new SelectListItem() { Value = a.DistributorId.ToString(), Text = a.DistributionName, Selected = (a.DistributorId == model.DistributorId) }).ToList(); }