Esempio n. 1
0
        public async Task <UserDepartmentDto> CreateAsync(UserDepartmentCreateDto input)
        {
            var userDepartment = ObjectMapper.Map <UserDepartmentCreateDto, UserDepartment>(input);

            var userDepartmentExist = await UserDepartmentRepository.GetByUserNameAsync(input.UserName);

            if (userDepartmentExist?.Id > 0)
            {
                throw new BusinessException(code: MasterDataErrorCodes.UserDepartment.UserNameExists)
                      .WithData("UserName", input.UserName);
            }

            userDepartment = await UserDepartmentRepository.InsertAsync(userDepartment);

            return(ObjectMapper.Map <UserDepartment, UserDepartmentDto>(userDepartment));
        }
 public Task <UserDepartmentDto> CreateAsync(UserDepartmentCreateDto input)
 {
     throw new NotImplementedException();
 }