public async Task DeleteAsync(Guid id)
        {
            var member = await _memberRepository.GetAsync(id);

            if (member is null)
            {
                throw new MemberNotFoundException(id);
            }

            await _memberRepository.DeleteAsync(member);
        }
Example #2
0
        public async Task <object> Delete(Guid id)
        {
            _logger.LogInformation($"delete.groupMember ${id}");
            Tk.AssertValidIds(id);
            var data = await _repository.DeleteAsync(id);

            _logger.LogInformation($"delete.groupMember ${id} result: {data}");
            return(new
            {
                Message = "Operation successful"
            });
        }
Example #3
0
        public async Task DeleteMemberAsync(Guid id)
        {
            try
            {
                var member = await _memberRepository.GetAsync(id);

                if (member == null)
                {
                    throw new EntityNotFoundException("No se ha encontrado el usuario a eliminar", "NotFound");
                }

                await _memberRepository.DeleteAsync(id);
            }
            catch (Exception ex)
            {
                _logger.LogError($"Error al eliminar el usuario: {ex.Message}", ex);
                throw;
            }
        }
Example #4
0
 public async Task DeleteAsync(Member user)
 {
     ValidateMember(user);
     await _repository.DeleteAsync(user);
 }
Example #5
0
        public async Task <IResultModel> Delete(int id)
        {
            var result = await _repository.DeleteAsync(id);

            return(ResultModel.Result(result));
        }
Example #6
0
        public async Task <ApiRequestResult> DeleteAsync([FromRoute] Guid id)
        {
            await _memberRepository.DeleteAsync(id);

            return(ApiRequestResult.Success("删除成功"));
        }
Example #7
0
        public async Task <MemberServiceModel> DeleteMemberAsync(int id)
        {
            Member member = await memberRepository.DeleteAsync(id);

            return(new MemberServiceModel(member));
        }