Magnesium is a bit more limited in its approach to casting. Die cast and sand cast are the main routes to cast components. Magnesium is alloyed to meet specific part needs. It is also the highest strength to weight ratio of all cast metals.
You will often see it used where weight savings/strength are paramount. Seeing it replace engineered plastics is a common approach when the plastic is failing.It is one of the best in all die cast alloys in tool life.
Magnesium is a possible alternative to aluminum castings where weight and tool life are a detriment. Net shape capability is excellent as well as mold to mold repeatability. Magnesium typically gets painted or plated to help with corrosion performance.