Cook spaghetti in a large saucepan of boiling salted water until al dente. Drain well.
Over a medium-low heat melt butter in a medium saucepan. Add onion to melted butter and stir until onion is soft. Add prawns and mushrooms, cook for 5 minutes stirring often. Remove prawns mixture from saucepan, place in a medium size bowl and set aside.
Remove saucepan from heat. Combine flour, mayonnaise, salt, milk and sherry in the saucepan. Mix well. Return the saucepan to the heat and cook until sauce thickens.
Pour sauce into the bowl containing the prawns mixture. Add the spaghetti to the bowl and mix well.
Place all ingredients in a baking dish. Sprinkle the Parmesan cheese on top of the mixture. Bake at 180 degrees C for 30 minutes.