Ejemplo n.º 1
0
        public async Task <JsonResponse> CreateAsync(UserRequestDto personRequestDto)
        {
            personRequestDto.Id = Guid.NewGuid().ToString();
            var resJson = await TryTransactionAsync(async() =>
            {
                var person = _mapper.Map <UserRequestDto, User>(personRequestDto);
                await DoValidationAsync(person, ValidatorTypeConstants.Create);
                await _userRespository.InsertAsync(person);
            });

            return(resJson);
        }