示例#1
0
        public async Task <ApiRequestResult> AddAsync(ProductMemberPriceDto dto)
        {
            var command = dto.EntityMap <ProductMemberPriceDto, ProductMemberPrice>();
            await _memberPriceRepository.AddAsync(command);

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

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

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