private void RemoveDisconnectedUsers(List <RoomUser> roomUsers) { foreach (var roomUser in roomUsers.Where(ru => ru.ActiveUser.IsDisconnected)) { //where filtered with new collection, I don't know the performance but I will see how //linq works under the hood, because I think the created collection doesn't affect performance _sessionRepo.RemoveActiveUser(roomUser.ActiveUser.Id); } }