public async Task <PeoplePhoneInformationDto> AddPeoplePhoneInformationAsync(AddPeoplePhoneRequestDto request, string userName) { _logger.LogDebug($"Adding new phone information for people with ID {request.PeopleId}. Request : {JsonConvert.SerializeObject(request)}"); await _addValidator.ValidateAndThrowAsync(request); var entity = _mapper.Map <PeoplePhoneInformation>(request); entity.IsObsolete = false; entity.CreatedDate = DateTime.Now; entity.LastUpdatedUserName = userName; _dbContext.PeoplePhoneInformations.Add(entity); await _dbContext.SaveChangesAsync(); return(_mapper.Map <PeoplePhoneInformationDto>(entity)); }
public async Task <PeoplePhoneInformationDto> AddPeoplePhoneInformationAsync(AddPeoplePhoneRequestDto request) { return(await _peoplePhoneInformationService.AddPeoplePhoneInformationAsync(request, Account?.FullName)); }