protected virtual async Task Update(TB_AlarmLogEntityEditDto input) { //TODO:更新前的逻辑判断,是否允许更新 var entity = await _tB_AlarmLogEntityRepository.GetAsync(input.C_ID); // input.MapTo(entity); //将input属性的值赋值到entity中 ObjectMapper.Map(input, entity); await _tB_AlarmLogEntityManager.UpdateAsync(entity); }
protected virtual async Task <TB_AlarmLogEntityEditDto> Create(TB_AlarmLogEntityEditDto input) { //TODO:新增前的逻辑判断,是否允许新增 var entity = ObjectMapper.Map <TB_AlarmLogEntity>(input); //调用领域服务 entity = await _tB_AlarmLogEntityManager.CreateAsync(entity); var dto = ObjectMapper.Map <TB_AlarmLogEntityEditDto>(entity); return(dto); }
public async Task <GetTB_AlarmLogEntityForEditOutput> GetForEdit(string input) { var output = new GetTB_AlarmLogEntityForEditOutput(); TB_AlarmLogEntityEditDto editDto; if (!string.IsNullOrEmpty(input)) { var entity = await _tB_AlarmLogEntityRepository.GetAsync(input); editDto = ObjectMapper.Map <TB_AlarmLogEntityEditDto>(entity); } else { editDto = new TB_AlarmLogEntityEditDto(); } output.TB_AlarmLogEntity = editDto; return(output); }