public void RemoveAssociation(RemoveAssociationViewModel removeAssociationViewModel) { var userTeam = _userTeamRepository.Get().FirstOrDefault(userTeam => userTeam.Team.Id == removeAssociationViewModel.FirstId && userTeam.User.Id == removeAssociationViewModel.SecondId); if (userTeam != null) { _userTeamRepository.Remove(userTeam.Id); _userTeamRepository.SaveChanges(); } }
public void RemoveAssociation(RemoveAssociationViewModel removeAssociationViewModel) { var projectTeam = _projectTeamRepository.Get().FirstOrDefault(projectTeam => projectTeam.Project.Id == removeAssociationViewModel.FirstId && projectTeam.Team.Id == removeAssociationViewModel.SecondId); if (projectTeam != null) { _projectTeamRepository.Remove(projectTeam.Id); _projectTeamRepository.SaveChanges(); } }
public IActionResult RemoveAssociation([FromBody] RemoveAssociationViewModel removeAssociationViewModel) { _projectAppService.RemoveAssociation(removeAssociationViewModel); return(Response()); }