Getting a property reference using reflection

var a = new obj();
var property = a.GetType().GetProperty("DB").GetValue(a,null) as testObject;

Does this mean that the variable propertycontains a reference to the same object that I received in object a, or was a new testObject created that contains the same values?

If this means creating a new object, then how can I get a reference to this property / support area using reflection?

+4
source share
3 answers

propertynow contains a link to everything that is in a DB.

, , , GetValue() , , , , Unboxing ( #):

[to object GetValue() case] .

+2

DB a, testType ( a PropertyInfo.GetValue), a DB.

+2

property , DB.

GetValue(a,null) return type - , .

+2
source

All Articles