Пример #1
0
        protected virtual async Task Update(AuditLogEditDto input)
        {
            //TODO:更新前的逻辑判断,是否允许更新

            var entity = await _auditLogRepository.GetAsync(input.Id.Value);

            input.MapTo(entity);

            // ObjectMapper.Map(input, entity);
            await _auditLogRepository.UpdateAsync(entity);
        }
Пример #2
0
        protected virtual async Task <AuditLogEditDto> Create(AuditLogEditDto input)
        {
            //TODO:新增前的逻辑判断,是否允许新增

            // var entity = ObjectMapper.Map <AuditLog>(input);
            var entity = input.MapTo <AuditLog>();


            entity = await _auditLogRepository.InsertAsync(entity);

            return(entity.MapTo <AuditLogEditDto>());
        }
Пример #3
0
        public async Task <GetAuditLogForEditOutput> GetForEdit(NullableIdDto <long> input)
        {
            var             output = new GetAuditLogForEditOutput();
            AuditLogEditDto editDto;

            if (input.Id.HasValue)
            {
                var entity = await _auditLogRepository.GetAsync(input.Id.Value);

                editDto = entity.MapTo <AuditLogEditDto>();

                //auditLogEditDto = ObjectMapper.Map<List<auditLogEditDto>>(entity);
            }
            else
            {
                editDto = new AuditLogEditDto();
            }

            output.AuditLog = editDto;
            return(output);
        }