public DepartmentQuery(IDepartmentManager departmentManager) { Field <ListGraphType <DepartmentModelType> > ( "departmentObject", resolve: context => departmentManager.GetAllDepartments() ); }
private List <UserRefreshModel> PopulateDepartmentIds(List <UserRefreshModel> model) { var departments = _departmentManager.GetAllDepartments(); foreach (var m in model) { m.DepartmentId = departments.Where(d => d.DepartmentName == m.Department).Select(di => di.Id).FirstOrDefault(); } return(model); }
public async Task <IActionResult> GetAllDepartmentsAsync() { var result = await _departmentManager.GetAllDepartments(); var departs = result.Select(x => _mapper.Map <DepartmentResponse>(x)).ToList(); var response = new DepartmentsResponse { Departments = departs }; return(Ok(response)); }
public ActionResult GetAllDepartment() { var result = departmentManager.GetAllDepartments(); return(Ok(result)); }
/// <summary> /// Gets this instance. /// </summary> /// <returns></returns> public IEnumerable <Department_vm> Get() { _logger.Info("Getting all Departments."); return(_nsDepartmentManager.GetAllDepartments()); }