Beispiel #1
0
        public async Task <UserDepartmentDto> UpdateAsync(long id, UserDepartmentUpdateDto input)
        {
            var userDepartment = await UserDepartmentRepository.GetByUserNameAsync(input.UserName);

            if (userDepartment != null &&
                userDepartment.Id > 0)
            {
                userDepartment.UserName       = input.UserName;
                userDepartment.DepartmentCode = input.DepartmentCode;
            }
            else
            {
                userDepartment = ObjectMapper.Map <UserDepartmentUpdateDto, UserDepartment>(input);
                userDepartment = await UserDepartmentRepository.InsertAsync(userDepartment);
            }

            return(ObjectMapper.Map <UserDepartment, UserDepartmentDto>(userDepartment));
        }
 public Task <UserDepartmentDto> UpdateAsync(long id, UserDepartmentUpdateDto input)
 {
     throw new NotImplementedException();
 }