public async Task <SystemDataTypeDto> AddSystemDataTypeAsync(AddSystemDataTypeRequestDto request, string userName)
        {
            _logger.LogDebug($"Add new system data type. Request : {JsonConvert.SerializeObject(request)}");
            await _addValidator.ValidateAndThrowAsync(request);

            var entity = _mapper.Map <SystemDataType>(request);

            entity.CreatedDate         = DateTime.Now;
            entity.LastUpdatedUserName = userName;

            _dbContext.SystemDataTypes.Add(entity);
            await _dbContext.SaveChangesAsync();

            return(_mapper.Map <SystemDataTypeDto>(entity));
        }
Пример #2
0
 public async Task <SystemDataTypeDto> AddSystemDataTypeAsync(AddSystemDataTypeRequestDto request)
 {
     return(await _systemDataTypeService.AddSystemDataTypeAsync(request, Account?.FullName));
 }