public async Task <ApiRequestResult> AddAsync(FlashPromotionDto dto) { var command = dto.EntityMap <FlashPromotionDto, FlashPromotion>(); await _flashPromotionRepository.AddAsync(command); return(ApiRequestResult.Success("添加成功")); }
public async Task <ApiRequestResult> UpdateAsync(FlashPromotionDto dto) { var entity = await _flashPromotionRepository.GetAsync(dto.Id.Value); var newEntity = dto.EntityMap(entity); await _flashPromotionRepository.UpdateAsync(newEntity); return(ApiRequestResult.Success("修改成功")); }