コード例 #1
0
 public DepartmentQuery(IDepartmentManager departmentManager)
 {
     Field <ListGraphType <DepartmentModelType> >
     (
         "departmentObject",
         resolve: context => departmentManager.GetAllDepartments()
     );
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        public ActionResult GetAllDepartment()
        {
            var result = departmentManager.GetAllDepartments();

            return(Ok(result));
        }
コード例 #5
0
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <returns></returns>
 public IEnumerable <Department_vm> Get()
 {
     _logger.Info("Getting all Departments.");
     return(_nsDepartmentManager.GetAllDepartments());
 }