public void DeleteFriends(int profileId) { List <Friend> friends = new List <Friend>(); foreach (Friend f in friendRepo.ByFromId(profileId, false)) { friends.Add(f); } foreach (Friend f in friendRepo.ByFromId(profileId, true)) { friends.Add(f); } foreach (Friend f in friendRepo.ByToId(profileId, false)) { friends.Add(f); } foreach (Friend f in friendRepo.ByToId(profileId, true)) { friends.Add(f); } if (friends.Count() == 0) { return; } foreach (Friend f in friends) { friendRepo.DeleteFriend(f); } }