Wondering curious maybe dumb...

Ok I have a few questions idk if someone can answer me. Ok, what would happen if your pregnant but don't know it yet and you attend to the dentist and get x rays done? Would it affect your unborn child? Or is it more just for precaution the dentist ask if your pregnant? Isn't the same thing if your pregnant and eat microwave food your still getting or being near radiationm