public void Kaldir(int User_Id, int Org_Id) { DbOrganization db = new DbOrganization(); OrganizationMember orgmem = db.OrganizationMembers.Where(c => c.Users.Id == User_Id && c.Organization.Id == Org_Id).FirstOrDefault(); _Orgmemrep.Delete(orgmem.Id); }
public async Task <bool> RemoveMemberFromOrganization(Guid organizationId, Guid userId) { OrganizationMember[] memberships = await OrganizationMemberRepository.GetByUserId(userId); OrganizationMember membership = memberships.FirstOrDefault(x => x.OrganizationId == organizationId); bool success = false; if (membership != null) { success = await OrganizationMemberRepository.Delete(membership.Id); } return(success); }