Example #1
0
        public async Task <ApiRequestResult> AddAsync(FlashPromotionSessionDto dto)
        {
            var command = dto.EntityMap <FlashPromotionSessionDto, FlashPromotionSession>();
            await _flashPromotionSessionRepository.AddAsync(command);

            return(ApiRequestResult.Success("添加成功"));
        }
Example #2
0
        public async Task <ApiRequestResult> UpdateAsync(FlashPromotionSessionDto dto)
        {
            var entity = await _flashPromotionSessionRepository.GetAsync(dto.Id.Value);

            var newEntity = dto.EntityMap(entity);
            await _flashPromotionSessionRepository.UpdateAsync(newEntity);

            return(ApiRequestResult.Success("修改成功"));
        }