コード例 #1
0
        public async Task <ApiRequestResult> AddAsync(MemberStatisticsInfoDto dto)
        {
            var command = dto.EntityMap <MemberStatisticsInfoDto, MemberStatisticsInfo>();
            await _memberStatisticsInfoRepository.AddAsync(command);

            return(ApiRequestResult.Success("添加成功"));
        }
コード例 #2
0
        public async Task <ApiRequestResult> UpdateAsync(MemberStatisticsInfoDto dto)
        {
            var entity = await _memberStatisticsInfoRepository.GetAsync(dto.Id.Value);

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

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