100% correct. It is a lifestyle disease and the reason your doctor won't tell you is because the health industry is built around treatment, not prevention, and so your doctor was never taught this. It's through no ill intent, it just never made good business since to teach doctors much about nutrition or to fund much of the research doctors may prefer to have before adopting new advice. Drug companies on the other hand do bury study results that don't help them, and the food industry does the same and intentionally misleads the public about making healthy diet choices.
Eating whole food plant based diet with moderate exercise usually reverses T2 diabetes and definitely prevents it.
This is a gross oversimplification. Diabetes (particularly type 2) is a complex disease with both environmental and genetic factors. I'm a T2 diabetic and was diagnosed while having a low BMI (20) and reasonably healthy lifestyle. There wasn't much I could actually change about my 'lifestyle' -- no weight to lose, etc. Medication was the only solution and not surprisingly made a significant impact.
Eating whole food plant based diet with moderate exercise usually reverses T2 diabetes and definitely prevents it.