protected virtual async Task Update(BatchCarEditDto input) { //TODO:更新前的逻辑判断,是否允许更新 var entity = await _batchCarRepository.FirstOrDefaultAsync(x => x.Id == input.Id); input.MapTo(entity); // ObjectMapper.Map(input, entity); await _batchCarRepository.UpdateAsync(entity); }
protected virtual async Task <BatchCarEditDto> Create(BatchCarEditDto input) { //TODO:新增前的逻辑判断,是否允许新增 // var entity = ObjectMapper.Map <BatchCar>(input); var entity = input.MapTo <BatchCar>(); entity = await _batchCarRepository.InsertAsync(entity); return(entity.MapTo <BatchCarEditDto>()); }