예제 #1
0
        public void RemoveMember(int membershipId)
        {
            var membership = GetMembership(membershipId);

            if (membership == null)
            {
                throw new ArgumentException("Invalid membership id");
            }
            try
            {
                _memberRepository.DeleteMember(membership);
            }
            catch
            {
                throw new ArgumentException("Database error");
            }
        }
예제 #2
0
        public async Task DeleteMember(Guid currentMemberId, Guid memberId)
        {
            Member member = await GetMember(currentMemberId, memberId);

            await _memberRepository.DeleteMember(member.Id);

            _cacheService.RemoveVersionedCollection <Member>(member.ChapterId);
            _cacheService.RemoveVersionedItem <Member>(memberId);
        }
        public IActionResult DeleteMember(int memberid)
        {
            var delRepo = _memberRepository.DeleteMember(memberid);

            if (!delRepo)
            {
                throw new Exception($"Deleting Member with {memberid} failed.");
            }
            return(NoContent());
        }
예제 #4
0
        public ActionResult Delete(int memberId)
        {
            Member member = repository.Members.FirstOrDefault(m => m.MemberID == memberId);

            if (member != null)
            {
                repository.DeleteMember(member);
                TempData["message"] = string.Format("{0} was deleted", member.Name);
            }
            return(RedirectToAction("Index"));
        }
예제 #5
0
        public async Task <bool> DeleteMember(int id)
        {
            var member = await _memberRepository.GetMember(id).ConfigureAwait(false);

            if (member != null)
            {
                await _memberRepository.DeleteMember(id).ConfigureAwait(false);

                return(true);
            }
            return(false);
        }
예제 #6
0
        public async Task DeleteMember(Guid memberId)
        {
            Member member = await _memberRepository.GetMember(memberId, true);

            if (member == null)
            {
                return;
            }

            await _memberRepository.DeleteMember(memberId);

            _cacheService.RemoveVersionedItem <Member>(memberId);
            _cacheService.RemoveVersionedCollection <Member>(member.ChapterId);
        }
        public void DeleteMember(Member member)
        {
            _blogSpaceDomainService.DeleteAllBlogSpaces(member.MemberUserName);

            Member toDelete = _memberRepository.GetMemberById(member.MemberId);

            if (toDelete != null)
            {
                _memberRepository.DeleteMember(toDelete);
            }
            else
            {
                throw new MemberNotFoundException();
            }
        }
예제 #8
0
        public bool DeleteGroup(int groupId)
        {
            var group = GetById(groupId, x => x.Members, x => x.Posts);

            if (group == null)
            {
                return(false);
            }
            foreach (var member in group.Members)
            {
                _memberRepository.DeleteMember(member);
            }
            foreach (var post in group.Posts)
            {
                _postRepository.DeletePost(post.Id);
            }
            _db.Groups.Remove(group);
            _db.SaveChanges();
            return(true);
        }
예제 #9
0
        public async Task <ReturnObject> Delete(int Id)
        {
            try
            {
                var obj = await _memberRepository.DeleteMember(Id);

                _retObj.Data          = obj;
                _retObj.Status        = true;
                _retObj.StatusMessage = "Successful!";

                return(_retObj);
            }
            catch (Exception ex)
            {
                _retObj.Status        = false;
                _retObj.StatusMessage = $"{_errMsg} {ex.Message}";
                _retObj.Data          = null;
                return(_retObj);
            }


            //await this._memberRepository.DeleteMember(Id);
        }
예제 #10
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            await _memberRepository.DeleteMember(id);

            return(RedirectToAction(nameof(Index)));
        }
예제 #11
0
 public void DeleteMember(int inId, IMemberRepository memberRepository)
 {
     memberRepository.DeleteMember(inId);
 }
예제 #12
0
 public void DeleteMember(int id)
 {
     _memberRepository.DeleteMember(id);
 }
        public async Task <ActionResult> DeleteAction(string id)
        {
            await _repo.DeleteMember(id);

            return(RedirectToAction("Index"));
        }
예제 #14
0
        public async Task <bool> DeleteMember(int id)
        {
            _logger.LogDebug($"Deleting member with Id: {id}.");

            return(await _memberRepository.DeleteMember(id));
        }