Butter an 8- by 8-inch baking dish. Preheat oven to 400°. Whisk the egg and cream together in a bowl. Set aside. Place a layer of the Jerusalem artichokes in the bottom of the pan. Sprinkle ½ cup of the cheese on top and a third of the chopped mushrooms. Sprinkle with a pinch of salt. Pour ½ cup of the egg/cream mixture over this. Repeat this process 2 more times, adding the shallot to the top layer. Cut the butter into slivers and place on top of the finished layers. Cover with foil and bake for 30–40 minutes, take off the foil and bake for another 15–20 minutes, until the top is golden and the Jerusalem artichokes are tender.