Let's say, for the sake of argument, I join the Brotherhood of Steel, therefore I get Danse as an available companion. I then, later, decide to join and side with the Railroad. If I remember correctly, as part of that I betray the Brotherhood so would I loose Danse as a companion? I know it seems obvious I will but I wanted to check.
In addition, do I retain him as a companion after I find out his secret, assuming I keep him alive?