System.Type
, is memoised, there isn't a System.Type
instance created everytime you instance an object of any given type, that would be extremely wasteful. You can check this out simply doing:
var type1 = (new Foo()).GetType();
var type2 = (new Foo()).GetType();
var areSame = ReferenceEquals(type1, type2); //returns true
As to when, how and in what order these memoised type instances are created, is not something I'd normally need to know the details about. To be frank, I find it hard to come up with a scenario where this knowledge would be useful. Care to further detail why you would need to know the exact mechanism?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…