Esempio n. 1
0
        /// <summary>
        /// 新增数据
        /// </summary>
        public async Task <DataTypeDto> Insert(DataTypeInputDto input)
        {
            try
            {
                input.Id = Guid.NewGuid().ToString();
                DataTypeEntity entity = new DataTypeEntity
                {
                    Id         = input.Id,
                    TypeName   = input.TypeName,
                    TypeDesc   = input.TypeDesc,
                    DictCodeID = input.DictCodeID,
                    ParentID   = input.ParentID
                };
                var query = await _IDataTypeRepository.InsertAsync(entity);

                var result = entity.MapTo <DataTypeDto>();
                return(result);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }