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"); } }
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()); }
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")); }
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); }
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(); } }
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); }
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); }
public async Task <IActionResult> DeleteConfirmed(int id) { await _memberRepository.DeleteMember(id); return(RedirectToAction(nameof(Index))); }
public void DeleteMember(int inId, IMemberRepository memberRepository) { memberRepository.DeleteMember(inId); }
public void DeleteMember(int id) { _memberRepository.DeleteMember(id); }
public async Task <ActionResult> DeleteAction(string id) { await _repo.DeleteMember(id); return(RedirectToAction("Index")); }
public async Task <bool> DeleteMember(int id) { _logger.LogDebug($"Deleting member with Id: {id}."); return(await _memberRepository.DeleteMember(id)); }