Exemplo n.º 1
0
        public async Task <ApiRequestResult> AddAsync(MemberReceiveAddressDto dto)
        {
            var command = dto.EntityMap <MemberReceiveAddressDto, MemberReceiveAddress>();
            await _memberReceiveAddressRepository.AddAsync(command);

            return(ApiRequestResult.Success("添加成功"));
        }
Exemplo n.º 2
0
        public async Task <ApiRequestResult> UpdateAsync(MemberReceiveAddressDto dto)
        {
            var entity = await _memberReceiveAddressRepository.GetAsync(dto.Id.Value);

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

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