public async Task <ListResultDto <DepartmentInfoDto> > GetAllDepartmentInfo(DepartmentInfoDto input) { var task = await _userRepository.GetAll().OrderByDescending(t => t.DepartmentID).ToListAsync(); return(new ListResultDto <DepartmentInfoDto>( AutoMapper.Mapper.Map <List <DepartmentInfoDto> >(task))); }
public void CreateMission(DepartmentInfoDto input) { var task = Mapper.Map <DepartmentInfo>(input); if (task != null) { _userRepository.InsertOrUpdate(task); } }
//public async Task<DepartmentInfoDto> GetMissionByIdAsync(int taskId) //{ // var task = await _userRepository.GetAll().Where(t => t.DepartmentID == taskId).ToListAsync(); // var result = Mapper.Map<DepartmentInfoDto>(task); // if (task != null) // { return result; } // else // { throw new NotImplementedException(); } //} public void UpdateMission(DepartmentInfoDto input, int id) { var task = _userRepository.GetAll().Where(t => t.DepartmentID == input.DepartmentID); var result = Mapper.Map <DepartmentInfo>(task); if (task != null) { _userRepository.Update(result); } }
public int CreateMissionQ(DepartmentInfoDto input) { var task = Mapper.Map <DepartmentInfo>(input); if (task != null) { int result = _userRepository.InsertAndGetId(task); return(result); } else { return(0); } }